]> granicus.if.org Git - php/commitdiff
fix format strings
authorSascha Schumann <sas@php.net>
Thu, 28 Aug 2003 16:04:18 +0000 (16:04 +0000)
committerSascha Schumann <sas@php.net>
Thu, 28 Aug 2003 16:04:18 +0000 (16:04 +0000)
ext/standard/assert.c
ext/standard/fsock.c
ext/standard/math.c
ext/standard/scanf.c
ext/standard/var.c
main/SAPI.c
main/streams.c

index 2e707040ec50c9fca2e0e32b771ce850bb8c6da3..a1f624352daaf3b4f2112513f83d5123738de5b7 100644 (file)
@@ -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;
        }
 
index 147bf318e6c3e19b9781a1f75d0bfb056dfdbe50..8552c4f3c0a284216ad7f2896dbc94bea9a57d4e 100644 (file)
@@ -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);
                }
index 22f6805dddef7fdf8f80901428fcf801b49e39cf..e062c923efb994713ece339708200109161b090f 100644 (file)
@@ -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;
        }
 
index 5905d76615d154e85f2e49360569992a9267aa76..542d2c5b73bde169287d1ffbef60221d03d2faca 100644 (file)
@@ -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");
         }
index 8a889ded3fc5bd9b55e9e71aabd361f444e0452c..4ff537a5e6deee13f4e09f846d36366adc08519b 100644 (file)
@@ -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;
index 00d8142c41aa5c2ebb5a0b4d3bbc4694706a5af3..ab9f3916d32cd74b1cff16af8e8e26e287906332 100644 (file)
@@ -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) {
index 8c32855e04362bf3d8be13b75f985d0c660c30cd..06a9a1a0d95bd2a5df967cce5f97695ddf1c7fb8 100755 (executable)
@@ -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;