abies Sat Aug 16 16:04:41 2003 EDT Modified files: /php-src/ext/interbase/tests 004.phpt Log: Fix failure on accidental fread() of 0 bytes Index: php-src/ext/interbase/tests/004.phpt diff -u php-src/ext/interbase/tests/004.phpt:1.5 php-src/ext/interbase/tests/004.phpt:1.6 --- php-src/ext/interbase/tests/004.phpt:1.5 Sat Aug 16 11:22:36 2003 +++ php-src/ext/interbase/tests/004.phpt Sat Aug 16 16:04:41 2003 @@ -36,7 +36,7 @@ $bl_h = ibase_blob_open($row->V_BLOB); $blob = ''; - while($piece = ibase_blob_get($bl_h, rand() % 1024)) + while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) $blob .= $piece; if($blob != $blob_str) echo " BLOB 1 fail (1)\n"; @@ -57,7 +57,7 @@ $bl_h = ibase_blob_create(); $ftmp = fopen($name,"r"); - while($piece = fread($ftmp, rand() % 1024)){ + while($piece = fread($ftmp, 1 + rand() % 1024)){ ibase_blob_add($bl_h, $piece); } fclose($ftmp); @@ -70,7 +70,7 @@ $row = ibase_fetch_object($q); $bl_h = ibase_blob_open($row->V_BLOB); $blob = ''; - while($piece = ibase_blob_get($bl_h, rand() % 1024)) + while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) $blob .= $piece; if($blob != $blob_str) echo " BLOB 2 fail\n";
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php