moriyoshi               Tue Dec 23 06:02:27 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/standard       file.c 
  Log:
  Fix fgetcsv()'s null line handling.
  # Thanks Takeshi Nakamura for reporting this bug.
  
  
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.279.2.47 php-src/ext/standard/file.c:1.279.2.48
--- php-src/ext/standard/file.c:1.279.2.47      Mon Dec 22 16:03:54 2003
+++ php-src/ext/standard/file.c Tue Dec 23 06:02:26 2003
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.279.2.47 2003/12/22 21:03:54 iliaa Exp $ */
+/* $Id: file.c,v 1.279.2.48 2003/12/23 11:02:26 moriyoshi Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2257,11 +2257,11 @@
        re = e = buf + buf_len;
 
        /* strip leading spaces */
-       while (isspace((int)*(unsigned char *)s) && *s != delimiter) {
+       while (isspace((int)*(unsigned char *)s) && *s != delimiter && s < re) {
                s++;
        }
        /* strip trailing spaces */
-       while (isspace((int)*(unsigned char *)(--e)) && *e != delimiter);
+       while (e >= s && isspace((int)*(unsigned char *)(--e)) && *e != delimiter);
        e++;
 
        array_init(return_value);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to