]> granicus.if.org Git - php/commitdiff
MFH
authorSterling Hughes <sterling@php.net>
Wed, 27 Nov 2002 20:32:26 +0000 (20:32 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 27 Nov 2002 20:32:26 +0000 (20:32 +0000)
ext/standard/file.c

index e08c3c0ee3d7dcda80d915f10340b37b68d6844e..a1c923d332d340d6b1f1961303f5490780da60d1 100644 (file)
@@ -1484,27 +1484,23 @@ PHP_FUNCTION(fscanf)
                RETURN_FALSE;
        }
 
-       len = SCAN_MAX_FSCANF_BUFSIZE;
 
-       buf = emalloc(len + 1);
-       /* needed because recv doesnt put a null at the end*/
-       memset(buf, 0, len+1);
-
-       if (php_stream_gets((php_stream *) what, buf, len) == NULL)     {
-               efree(buf);
+       buf = php_stream_get_line((php_stream *) what, NULL, 0, &len);
+       if (buf == NULL) {
                RETURN_FALSE;
        }
 
        convert_to_string_ex(format_string);
        result = php_sscanf_internal(buf, Z_STRVAL_PP(format_string),
                        argCount, args, 2, &return_value TSRMLS_CC);
+
        efree(args);
        efree(buf);
+
        if (SCAN_ERROR_WRONG_PARAM_COUNT == result) {
-               WRONG_PARAM_COUNT
+               WRONG_PARAM_COUNT;
        }
 
-
 }
 /* }}} */