diff options
| author | Felipe Pena <felipe@php.net> | 2009-02-06 10:22:34 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2009-02-06 10:22:34 +0000 |
| commit | ac2a97209b7c5313654bb2d124235199afe19f6f (patch) | |
| tree | ddf4c03f8730de1642ac21b7684025f955ccc65a | |
| parent | c9407016127865b4f028b52314d9793986fc1440 (diff) | |
| download | php-git-ac2a97209b7c5313654bb2d124235199afe19f6f.tar.gz | |
- MFH: Fixed bug #47322 (sscanf %d does't work)
| -rw-r--r-- | NEWS | 1 | ||||
| -rw-r--r-- | ext/standard/scanf.c | 4 | ||||
| -rw-r--r-- | ext/standard/tests/strings/bug47322.phpt | 19 |
3 files changed, 22 insertions, 2 deletions
@@ -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-- +<?php + +sscanf("15:59:58.2","%d:%d:%f", $a, $b, $c); +echo "[$a][$b][$c]\n"; + +sscanf("15:59:58.2","%d:%d:%f", $a, $b, $c); +echo "[$a][$b][$c]\n"; + +sscanf("15:59:foo","%d:%d:%s", $a, $b, $c); +echo "[$a][$b][$c]\n"; + +?> +--EXPECT-- +[15][59][58.2] +[15][59][58.2] +[15][59][foo] |
