diff options
Diffstat (limited to 'report.c')
-rw-r--r-- | report.c | 40 |
1 files changed, 19 insertions, 21 deletions
@@ -315,8 +315,7 @@ error_build (message, va_alist) partial_message = xrealloc (partial_message, partial_message_size); } #else - VA_START (args, message); - vsprintf (partial_message + partial_message_size_used, message, args); + sprintf (partial_message + partial_message_size_used, message, a1, a2, a3, a4, a5, a6, a7, a8); /* Attempt to catch memory overwrites... */ if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) @@ -324,7 +323,6 @@ error_build (message, va_alist) partial_message_size_used = 0; error (PS_UNDEFINED, 0, "partial error message buffer overflow"); } - va_end (args); #endif #endif @@ -407,8 +405,7 @@ error_complete (status, errnum, message, va_alist) partial_message = xrealloc (partial_message, partial_message_size); } #else - VA_START (args, message); - vsprintf (partial_message + partial_message_size_used, message, args); + sprintf (partial_message + partial_message_size_used, message, a1, a2, a3, a4, a5, a6, a7, a8); /* Attempt to catch memory overwrites... */ if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) @@ -416,28 +413,29 @@ error_complete (status, errnum, message, va_alist) partial_message_size_used = 0; error (PS_UNDEFINED, 0, "partial error message buffer overflow"); } - va_end (args); #endif #endif /* Finally... print it. */ - if (partial_message_size_used != 0) + partial_message_size_used = 0; + + if (use_stderr) { - partial_message_size_used = 0; - if (use_stderr) - { - fputs(partial_message, stderr); - if (errnum) - fprintf (stderr, ": %s", strerror (errnum)); - putc ('\n', stderr); - fflush (stderr); - ++error_message_count; - if (status) - exit(status); - } - else - error (status, errnum, "%s", partial_message); + fputs(partial_message, stderr); + + if (errnum) + fprintf (stderr, ": %s", strerror (errnum)); + + putc ('\n', stderr); + fflush (stderr); + + ++error_message_count; + + if (status) + exit(status); } + else + error (status, errnum, "%s", partial_message); } /* Sometimes we want to have at most one error per line. This |