From ce635bdb3c9ef72d9901e7f96f9efcac6cd5182a Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Tue, 15 Aug 2000 17:05:37 +0000 Subject: [PATCH] Fix varargs handling. The assignments are not necessary at all and cause problems on various platforms, so we get rid of them. --- main/main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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; -- 2.50.1