Skip to content

Commit 86a447d

Browse files
committed
ext/standard/scanf: use uint32_t type instead of int for argCount argument
1 parent 878fb75 commit 86a447d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

ext/spl/spl_directory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ PHP_METHOD(SplFileObject, fscanf)
24942494
RETURN_THROWS();
24952495
}
24962496

2497-
php_sscanf_internal(ZSTR_VAL(intern->u.file.current_line), ZSTR_VAL(format_str), (int)num_varargs, varargs, 0, return_value);
2497+
php_sscanf_internal(ZSTR_VAL(intern->u.file.current_line), ZSTR_VAL(format_str), num_varargs, varargs, 0, return_value);
24982498
}
24992499
/* }}} */
25002500

ext/standard/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ PHPAPI PHP_FUNCTION(fgetc)
928928
/* {{{ Implements a mostly ANSI compatible fscanf() */
929929
PHP_FUNCTION(fscanf)
930930
{
931-
int argc = 0;
931+
uint32_t argc = 0;
932932
size_t format_len;
933933
zval *args = NULL;
934934
zval *file_handle;

ext/standard/scanf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
572572
*/
573573

574574
PHPAPI int php_sscanf_internal( char *string, char *format,
575-
int argCount, zval *args,
575+
uint32_t argCount, zval *args,
576576
int varStart, zval *return_value)
577577
{
578578
int numVars, nconversions, totalVars = -1;

ext/standard/scanf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* e.g. fscanf
3535
*/
3636
PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars);
37-
PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval *args,
37+
PHPAPI int php_sscanf_internal(char *string,char *format,uint32_t argCount,zval *args,
3838
int varStart, zval *return_value);
3939

4040

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5862,7 +5862,7 @@ PHP_FUNCTION(sscanf)
58625862
zval *args = NULL;
58635863
char *str, *format;
58645864
size_t str_len, format_len;
5865-
int num_args = 0;
5865+
uint32_t num_args = 0;
58665866

58675867
ZEND_PARSE_PARAMETERS_START(2, -1)
58685868
Z_PARAM_STRING(str, str_len)

0 commit comments

Comments
 (0)