mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
fix format strings
This commit is contained in:
parent
341b7b5df1
commit
436a07176c
7 changed files with 20 additions and 20 deletions
|
@ -276,7 +276,7 @@ PHP_FUNCTION(assert_options)
|
|||
break;
|
||||
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %d", Z_LVAL_PP(what));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %ld", Z_LVAL_PP(what));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -547,7 +547,7 @@ PHP_FUNCTION(file_put_contents)
|
|||
break;
|
||||
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The 2nd parameter should be either a string or an array.", flags);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The 2nd parameter should be either a string or an array.");
|
||||
numbytes = -1;
|
||||
break;
|
||||
|
||||
|
@ -588,7 +588,7 @@ PHP_FUNCTION(file)
|
|||
return;
|
||||
}
|
||||
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%d' flag is not supported.", flags);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%ld' flag is not supported.", flags);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1500,15 +1500,15 @@ static php_stream_filter_status_t strfilter_convert_filter(
|
|||
|
||||
switch (err) {
|
||||
case PHP_CONV_ERR_UNKNOWN:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername, err);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
|
||||
goto out_failure;
|
||||
|
||||
case PHP_CONV_ERR_INVALID_SEQ:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername, err);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername);
|
||||
goto out_failure;
|
||||
|
||||
case PHP_CONV_ERR_UNEXPECTED_EOS:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername, err);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
|
||||
goto out_failure;
|
||||
|
||||
default:
|
||||
|
@ -1573,15 +1573,15 @@ static php_stream_filter_status_t strfilter_convert_filter(
|
|||
|
||||
switch (err) {
|
||||
case PHP_CONV_ERR_UNKNOWN:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername, err);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
|
||||
goto out_failure;
|
||||
|
||||
case PHP_CONV_ERR_INVALID_SEQ:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername, err);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername);
|
||||
goto out_failure;
|
||||
|
||||
case PHP_CONV_ERR_UNEXPECTED_EOS:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername, err);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
|
||||
goto out_failure;
|
||||
|
||||
default:
|
||||
|
|
|
@ -83,7 +83,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
|||
efree(hostname);
|
||||
}
|
||||
if (stream == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:%d (%s)", host, port, errstr == NULL ? "Unknown error" : errstr);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:%ld (%s)", host, port, errstr == NULL ? "Unknown error" : errstr);
|
||||
}
|
||||
|
||||
if (hashkey) {
|
||||
|
|
|
@ -968,11 +968,11 @@ PHP_FUNCTION(base_convert)
|
|||
convert_to_long_ex(frombase);
|
||||
convert_to_long_ex(tobase);
|
||||
if (Z_LVAL_PP(frombase) < 2 || Z_LVAL_PP(frombase) > 36) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base' (%d)", Z_LVAL_PP(frombase));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base' (%ld)", Z_LVAL_PP(frombase));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (Z_LVAL_PP(tobase) < 2 || Z_LVAL_PP(tobase) > 36) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%d)", Z_LVAL_PP(tobase));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%ld)", Z_LVAL_PP(tobase));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -535,7 +535,7 @@ PHP_FUNCTION(proc_open)
|
|||
#else
|
||||
descriptors[ndesc].childend = dup(fd);
|
||||
if (descriptors[ndesc].childend < 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d - %s", nindex, strerror(errno));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %ld - %s", nindex, strerror(errno));
|
||||
goto exit_fail;
|
||||
}
|
||||
#endif
|
||||
|
@ -560,7 +560,7 @@ PHP_FUNCTION(proc_open)
|
|||
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zmode) == SUCCESS) {
|
||||
convert_to_string_ex(zmode);
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'", Z_STRVAL_PP(ztype));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'");
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
|
@ -601,14 +601,14 @@ PHP_FUNCTION(proc_open)
|
|||
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zfile) == SUCCESS) {
|
||||
convert_to_string_ex(zfile);
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'", Z_STRVAL_PP(ztype));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'");
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 2, (void **)&zmode) == SUCCESS) {
|
||||
convert_to_string_ex(zmode);
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'", Z_STRVAL_PP(ztype));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'");
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
|
|||
gotSequential = 1;
|
||||
if (gotXpg) {
|
||||
mixedXPG:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot mix \"%\" and \"%n$\" conversion specifiers");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
|
|||
goto error;
|
||||
default:
|
||||
{
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion character \"%c\"", ch);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion character \"%c\"", *ch);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -545,7 +545,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
|
|||
}
|
||||
for (i = 0; i < numVars; i++) {
|
||||
if (nassign[i] > 1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is assigned by multiple \"%n$\" conversion specifiers");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers");
|
||||
goto error;
|
||||
} else if (!xpgSize && (nassign[i] == 0)) {
|
||||
/*
|
||||
|
@ -564,7 +564,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
|
|||
|
||||
badIndex:
|
||||
if (gotXpg) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "\"%n$\" argument index out of range");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "\"%n$\" argument index out of range");
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Different numbers of variable names and field specifiers");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue