]> granicus.if.org Git - php/commitdiff
fix format strings
authorSascha Schumann <sas@php.net>
Thu, 28 Aug 2003 16:49:57 +0000 (16:49 +0000)
committerSascha Schumann <sas@php.net>
Thu, 28 Aug 2003 16:49:57 +0000 (16:49 +0000)
ext/standard/assert.c
ext/standard/file.c
ext/standard/filters.c
ext/standard/fsock.c
ext/standard/math.c
ext/standard/proc_open.c
ext/standard/scanf.c

index c01d0c66228e01e50f83a70d326484d2136514ed..fddd08702a79246e85f5b2176af9bba4e549bccb 100644 (file)
@@ -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;
        }
 
index b59c79a802a6f384e5006b8c2594a2178bf4d36d..c6829ae66b5e68e787786d2f1b7e40363955c4ad 100644 (file)
@@ -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;
        }
        
index 1e64cc19a1285aa7a09c7eee117173dccbd24cca..ae7dfa8c4a06b09f40f6fdba058d9726796ce365 100644 (file)
@@ -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:
index 493296538346eee0f44af5d5f2bcefdf0530af98..0d3df92fbd7276eb997d0d3fe878ae0a6e73ec2b 100644 (file)
@@ -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) {
index 7d7c73f84b4ee19a74e230424852f371d673ee81..a9a86e6f81e778eb36ed97660adaf8e3f11e9989 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 5a17e91bc2dec0857584402ef8b7d3f614d92974..daf498505078e9a3e9be9e8dbc9ee1ced059e3a8 100644 (file)
@@ -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;
                                }
 
index 832272134e4d0de2c051446571c9130717d8600a..ae3646da2abe353a5730cef92e4e2ba141ecd2ae 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");
        }