From 41c1ea1b0573d93d743eb84018f80815d7a1f341 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 28 Aug 2003 16:04:18 +0000 Subject: [PATCH] fix format strings --- ext/standard/assert.c | 2 +- ext/standard/fsock.c | 2 +- ext/standard/math.c | 4 ++-- ext/standard/scanf.c | 8 ++++---- ext/standard/var.c | 2 +- main/SAPI.c | 4 ++-- main/streams.c | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 2e707040ec..a1f624352d 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -280,7 +280,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; } diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 147bf318e6..8552c4f3c0 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -229,7 +229,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) err = php_socket_errno(); if (stream == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:%d", host, port); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:%ld", host, port); } else if (context) { php_stream_context_set(stream, context); } diff --git a/ext/standard/math.c b/ext/standard/math.c index 22f6805ddd..e062c923ef 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -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; } diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 5905d76615..542d2c5b73 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -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"); } diff --git a/ext/standard/var.c b/ext/standard/var.c index 8a889ded3f..4ff537a5e6 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -514,7 +514,7 @@ static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *va char *s; ulong slen; - slen = spprintf(&s, 0, "d:%.*G;", PG(serialize_precision), Z_DVAL_PP(struc)); + slen = spprintf(&s, 0, "d:%.*G;", (int) PG(serialize_precision), Z_DVAL_PP(struc)); smart_str_appendl(buf, s, slen); efree(s); return; diff --git a/main/SAPI.c b/main/SAPI.c index 00d8142c41..ab9f3916d3 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -186,7 +186,7 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) int allocated_bytes=SAPI_POST_BLOCK_SIZE+1; if (SG(request_info).content_length > SG(post_max_size)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %d bytes exceeds the limit of %d bytes", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_length, SG(post_max_size)); return; } @@ -199,7 +199,7 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) } SG(read_post_bytes) += read_bytes; if (SG(read_post_bytes) > SG(post_max_size)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %d bytes", SG(post_max_size)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %ld bytes", SG(post_max_size)); return; } if (read_bytes < SAPI_POST_BLOCK_SIZE) { diff --git a/main/streams.c b/main/streams.c index 8c32855e04..06a9a1a0d9 100755 --- a/main/streams.c +++ b/main/streams.c @@ -2653,7 +2653,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio char *tmp = estrdup(path); php_strip_url_passwd(tmp); php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "could not make seekable - %s", - tmp, strerror(errno)); + tmp); efree(tmp); options ^= REPORT_ERRORS; -- 2.40.0