[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard scanf.c
kalle Thu Apr 2 05:17:36 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard scanf.c Log: MFH: We dont need to escape % here, it just generates a compiler warning http://cvs.php.net/viewvc.cgi/php-src/ext/standard/scanf.c?r1=1.31.2.2.2.5.2.5r2=1.31.2.2.2.5.2.6diff_format=u Index: php-src/ext/standard/scanf.c diff -u php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.5 php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.6 --- php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.5 Fri Feb 6 10:20:09 2009 +++ php-src/ext/standard/scanf.cThu Apr 2 05:17:36 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: scanf.c,v 1.31.2.2.2.5.2.5 2009/02/06 10:20:09 felipe Exp $ */ +/* $Id: scanf.c,v 1.31.2.2.2.5.2.6 2009/04/02 05:17:36 kalle Exp $ */ /* scanf.c -- @@ -394,7 +394,7 @@ gotSequential = 1; if (gotXpg) { mixedXPG: - php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, cannot mix \\%\ and \\%n$\ conversion specifiers); + php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, cannot mix \%\ and \%n$\ conversion specifiers); goto error; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard scanf.c /ext/standard/tests/strings bug47322.phpt
felipe Fri Feb 6 10:20:09 2009 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/strings bug47322.phpt Modified files: /php-src/ext/standard scanf.c Log: - MFH: Fixed bug #47322 (sscanf %d does't work) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/scanf.c?r1=1.31.2.2.2.5.2.4r2=1.31.2.2.2.5.2.5diff_format=u Index: php-src/ext/standard/scanf.c diff -u php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.4 php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.5 --- php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.4 Mon Jan 19 09:52:24 2009 +++ php-src/ext/standard/scanf.cFri Feb 6 10:20:09 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: scanf.c,v 1.31.2.2.2.5.2.4 2009/01/19 09:52:24 tony2001 Exp $ */ +/* $Id: scanf.c,v 1.31.2.2.2.5.2.5 2009/02/06 10:20:09 felipe Exp $ */ /* scanf.c -- @@ -1078,7 +1078,7 @@ } 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 @@ } 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 ); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug47322.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/strings/bug47322.phpt +++ php-src/ext/standard/tests/strings/bug47322.phpt --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] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard scanf.c
tony2001Mon Jan 19 09:52:24 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard scanf.c Log: MFH: fix memleaks in sscanf() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/scanf.c?r1=1.31.2.2.2.5.2.3r2=1.31.2.2.2.5.2.4diff_format=u Index: php-src/ext/standard/scanf.c diff -u php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.3 php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.4 --- php-src/ext/standard/scanf.c:1.31.2.2.2.5.2.3 Wed Dec 31 11:15:45 2008 +++ php-src/ext/standard/scanf.cMon Jan 19 09:52:24 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: scanf.c,v 1.31.2.2.2.5.2.3 2008/12/31 11:15:45 sebastian Exp $ */ +/* $Id: scanf.c,v 1.31.2.2.2.5.2.4 2009/01/19 09:52:24 tony2001 Exp $ */ /* scanf.c -- @@ -934,7 +934,7 @@ __buf[0] = sch; __buf[1] = '\0';; current = args[objIndex++]; - convert_to_string_ex( current ); + zval_dtor(*current); ZVAL_STRINGL( *current, __buf, 1, 1); } else { add_index_stringl(*return_value, objIndex++, sch, 1, 1); @@ -1066,9 +1066,9 @@ break; } else if (numVars) { /* change passed value type to string */ - current = args[objIndex++]; - convert_to_string( *current ); - ZVAL_STRING( *current, buf, 1 ); + current = args[objIndex++]; + zval_dtor(*current); + ZVAL_STRING( *current, buf, 1 ); } else { add_index_string(*return_value, objIndex++, buf, 1); } @@ -1077,7 +1077,7 @@ break; } else if (numVars) { current = args[objIndex++]; - convert_to_long( *current ); + zval_dtor(*current); Z_LVAL(**current) = value; } else { add_index_long(*return_value, objIndex++, value); @@ -1182,7 +1182,7 @@ break; } else if (numVars) { current = args[objIndex++]; - convert_to_double( *current ); + zval_dtor(*current); Z_DVAL_PP( current ) = dvalue; } else { add_index_double( *return_value, objIndex++, dvalue ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php