@@ -299,7 +299,7 @@ static void ReleaseCharSet(CharSet *cset)
299299 *
300300 *----------------------------------------------------------------------
301301*/
302- static int ValidateFormat (const zend_string * zstr_format , uint32_t numVars , uint32_t * totalSubs )
302+ static int ValidateFormat (const zend_string * zstr_format , uint32_t format_arg_num , uint32_t numVars , uint32_t * totalSubs )
303303{
304304#define STATIC_LIST_SIZE 16
305305 int flags ;
@@ -571,7 +571,7 @@ static int ValidateFormat(const zend_string *zstr_format, uint32_t numVars, uint
571571 * return_value set with the results of the scan
572572 */
573573
574- PHPAPI int php_sscanf_internal (const char * string , const zend_string * zstr_format ,
574+ PHPAPI int php_sscanf_internal (const char * string , const zend_string * zstr_format , uint32_t format_arg_num ,
575575 uint32_t argCount , zval * args ,
576576 zval * return_value )
577577{
@@ -602,7 +602,7 @@ PHPAPI int php_sscanf_internal(const char *string, const zend_string *zstr_forma
602602 * Check for errors in the format string.
603603 */
604604 uint32_t totalVars = 0 ;
605- if (ValidateFormat (zstr_format , numVars , & totalVars ) != SCAN_SUCCESS ) {
605+ if (ValidateFormat (zstr_format , format_arg_num , numVars , & totalVars ) != SCAN_SUCCESS ) {
606606 scan_set_error_return ( assignToVariables , return_value );
607607 return SCAN_ERROR_INVALID_FORMAT ;
608608 }
0 commit comments