From: Felipe Pena Date: Fri, 6 Feb 2009 10:22:34 +0000 (+0000) Subject: - MFH: Fixed bug #47322 (sscanf %d does't work) X-Git-Tag: php-5.2.9RC2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac2a97209b7c5313654bb2d124235199afe19f6f;p=php - MFH: Fixed bug #47322 (sscanf %d does't work) --- diff --git a/NEWS b/NEWS index f432c8aa21..9eb31dc698 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Feb 2009, PHP 5.2.9 +- Fixed bug #47322 (sscanf %d does't work). (Felipe) 02 Feb 2009, PHP 5.2.9RC1 - Changed __call() to be invoked on private/protected method access, similar to diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 65030e98f6..781a5b52f1 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -1078,7 +1078,7 @@ addToInt: } else if (numVars) { current = args[objIndex++]; zval_dtor(*current); - Z_LVAL(**current) = value; + ZVAL_LONG(*current, value); } else { add_index_long(*return_value, objIndex++, value); } @@ -1183,7 +1183,7 @@ addToFloat: } else if (numVars) { current = args[objIndex++]; zval_dtor(*current); - Z_DVAL_PP( current ) = dvalue; + ZVAL_DOUBLE(*current, dvalue); } else { add_index_double( *return_value, objIndex++, dvalue ); } diff --git a/ext/standard/tests/strings/bug47322.phpt b/ext/standard/tests/strings/bug47322.phpt new file mode 100644 index 0000000000..4ca78ee7a0 --- /dev/null +++ b/ext/standard/tests/strings/bug47322.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #47322 (sscanf %d does't work) +--FILE-- + +--EXPECT-- +[15][59][58.2] +[15][59][58.2] +[15][59][foo]