From: Sascha Schumann Date: Tue, 15 Aug 2000 17:05:37 +0000 (+0000) Subject: Fix varargs handling. The assignments are not necessary at all and X-Git-Tag: php-4.0.2RC1~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce635bdb3c9ef72d9901e7f96f9efcac6cd5182a;p=php Fix varargs handling. The assignments are not necessary at all and cause problems on various platforms, so we get rid of them. --- diff --git a/main/main.c b/main/main.c index 3f24facad6..c39af4e537 100644 --- a/main/main.c +++ b/main/main.c @@ -330,7 +330,6 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ { char buffer[1024]; int size = 0; - va_list args; ELS_FETCH(); PLS_FETCH(); @@ -366,9 +365,9 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ /* get include file name */ if (PG(log_errors) || PG(display_errors) || (!module_initialized)) { - args = orig_args; - size = vsnprintf(buffer, sizeof(buffer) - 1, format, args); - va_end(args); + size = vsnprintf(buffer, sizeof(buffer) - 1, format, orig_args); + va_end(orig_args); + buffer[sizeof(buffer) - 1] = 0; if (!module_initialized || PG(log_errors)) { @@ -442,9 +441,8 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ if (PG(track_errors) && EG(active_symbol_table)) { pval *tmp; - args = orig_args; - size = vsnprintf(buffer, sizeof(buffer) - 1, format, args); - va_end(args); + size = vsnprintf(buffer, sizeof(buffer) - 1, format, orig_args); + va_end(orig_args); buffer[sizeof(buffer) - 1] = 0;