[Zope-Checkins] CVS: Products/DCOracle2/src - dco2.c:1.108

Matthew T. Kromer matt@zope.com
Tue, 23 Apr 2002 15:40:58 -0400


Update of /cvs-repository/Products/DCOracle2/src
In directory cvs.zope.org:/tmp/cvs-serv12272/src

Modified Files:
	dco2.c 
Log Message:
Fix null length read on LobLocators so it doesn't ask Oracle for something
that has 0 length on a read.


=== Products/DCOracle2/src/dco2.c 1.107 => 1.108 ===
 	string = PyString_FromStringAndSize(NULL, length);
 	if (string == NULL) return NULL;
+	
+	if (length == 0) {	/* Short circuit a zero-length read */
+		TRACE(T_EXIT,("ss","LobLocator_read","returning 0 len str"));
+		return string;
+	}
 
 	buff = PyString_AsString(string);