From 757849cd93a9bc361a5113e3aaafe516773aad44 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 23 Nov 2013 22:23:52 -0500 Subject: [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. --- commands.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index f910358..7c7eabf 100644 --- a/commands.c +++ b/commands.c @@ -403,7 +403,7 @@ chop_commands (struct commands *cmds) CMDS->any_recurse flag. */ if (nlines > USHRT_MAX) - fatal (&cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines); + ON (fatal, &cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines); cmds->ncommand_lines = nlines; cmds->command_lines = lines; @@ -627,11 +627,13 @@ delete_target (struct file *file, const char *on_behalf_of) if (ar_member_date (file->name) != file_date) { if (on_behalf_of) - error (NILF, _("*** [%s] Archive member '%s' may be bogus; not deleted"), - on_behalf_of, file->name); + OSS (error, NILF, + _("*** [%s] Archive member '%s' may be bogus; not deleted"), + on_behalf_of, file->name); else - error (NILF, _("*** Archive member '%s' may be bogus; not deleted"), - file->name); + OS (error, NILF, + _("*** Archive member '%s' may be bogus; not deleted"), + file->name); } return; } @@ -643,9 +645,10 @@ delete_target (struct file *file, const char *on_behalf_of) && FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime) { if (on_behalf_of) - error (NILF, _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name); + OSS (error, NILF, + _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name); else - error (NILF, _("*** Deleting file '%s'"), file->name); + OS (error, NILF, _("*** Deleting file '%s'"), file->name); if (unlink (file->name) < 0 && errno != ENOENT) /* It disappeared; so what. */ perror_with_name ("unlink: ", file->name); -- cgit v1.2.3