[SV 40361] Don't use vsnprintf(), which is an ISO C99 function.

* output.c (error, fatal, message): Take an extra argument specifying
how many bytes are used by the formatted arguments.
(get_buffer): New function that allocates the requested buffer size.
Remove msc_vsnprintf(), vfmtconcat(), and fmtconcat() as unneeded.
* makeint.h: Declare various helper macros for generating output.
* *.c: Change all error(), fatal(), message() calls to use the macros,
or pass the extra length argument directly.
This commit is contained in:
Paul Smith
2013-11-23 22:23:52 -05:00
parent 9d58570c77
commit 757849cd93
22 changed files with 427 additions and 383 deletions

View File

@@ -219,10 +219,10 @@ void undefine_variable_in_set (const char *name, unsigned int length,
/* Warn that NAME is an undefined variable. */
#define warn_undefined(n,l) do{\
if (warn_undefined_variables_flag) \
error (reading_file, \
if (warn_undefined_variables_flag) \
error (reading_file, (l), \
_("warning: undefined variable '%.*s'"), \
(int)(l), (n)); \
(int)(l), (n)); \
}while(0)
char **target_environment (struct file *file);