cvs: php-src /ext/standard file.c
| From: | Marcus Boerger | Date: | Mon, 07 Mar 2005 21:54:08 +0000 |
| Subject: | cvs: php-src /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-30766@lists.php.net to get a copy of this message | ||
helly Mon Mar 7 16:54:08 2005 EDT
Modified files:
/php-src/ext/standard file.c
Log:
- Length needs to be positive
http://cvs.php.net/diff.php/php-src/ext/standard/file.c?r1=1.402&r2=1.403&ty=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.402 php-src/ext/standard/file.c:1.403
--- php-src/ext/standard/file.c:1.402 Mon Mar 7 16:52:34 2005
+++ php-src/ext/standard/file.c Mon Mar 7 16:54:08 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.402 2005/03/07 21:52:34 helly Exp $ */
+/* $Id: file.c,v 1.403 2005/03/07 21:54:08 helly Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1229,7 +1229,7 @@
}
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
- num_bytes = MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2));
+ num_bytes = MAX(0, MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2)));
break;
default: