From: Thies C. Arntzen Date: Sat, 7 Oct 2000 09:10:54 +0000 (+0000) Subject: @- Fixed returning of empty LOB fields in OCI8. (Thies) X-Git-Tag: php-4.0.3~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b5441c30fb93353496e4a2723b063cebe372db8;p=php @- Fixed returning of empty LOB fields in OCI8. (Thies) --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 2d0142f2eb..0e34f4caa7 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1555,7 +1555,7 @@ static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,ub4 *loblen) { ub4 siz = 0; - ub4 readlen; + ub4 readlen = 0; char *buf; *loblen = 0; @@ -1572,7 +1572,6 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u } } - connection->error = OCILobGetLength(connection->pServiceContext, connection->pError, @@ -1586,7 +1585,7 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u buf = emalloc(readlen + 1); - do { + while (readlen > 0) { /* thies loop should not be entered on readlen == 0 */ connection->error = OCILobRead(connection->pServiceContext, connection->pError, @@ -1609,7 +1608,7 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u } else { break; } - } while (1); + } if (connection->error) { oci_error(connection->pError, "OCILobRead", connection->error);