]> granicus.if.org Git - php/commitdiff
Fix by-reference passing for scanf's
authorStanislav Malyshev <stas@php.net>
Sun, 20 Aug 2000 16:09:06 +0000 (16:09 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 20 Aug 2000 16:09:06 +0000 (16:09 +0000)
@- Fix by-reference parameters passing for xml_ functions and for scanf functions (Stas)

ext/standard/basic_functions.c

index bd7781d04bda77679bcb216af9ce4e0d7483daae..13f8e1961f9e986ab097839fead0ec02357e60a4 100644 (file)
@@ -64,6 +64,7 @@ static unsigned char second_and_third_args_force_ref[] = { 3, BYREF_NONE, BYREF_
 static unsigned char second_args_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
 static unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
 static unsigned char third_and_fourth_args_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_FORCE };
+static unsigned char third_and_rest_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE_REST };
 
 typedef struct _php_shutdown_function_entry {
        zval **arguments;
@@ -177,8 +178,8 @@ function_entry basic_functions[] = {
        PHP_FALIAS(strchr,                      strstr,                         NULL)
        PHP_NAMED_FE(sprintf,           PHP_FN(user_sprintf),   NULL)
        PHP_NAMED_FE(printf,            PHP_FN(user_printf),    NULL)
-    PHP_FE(sscanf,                                  NULL)
-    PHP_FE(fscanf,                                  NULL)
+    PHP_FE(sscanf,                                  third_and_rest_force_ref)
+    PHP_FE(fscanf,                                  third_and_rest_force_ref)
 
        PHP_FE(parse_url,                                                               NULL)
        PHP_FE(urlencode,                                                               NULL)