From: Alan Modra Date: Mon, 25 Oct 2021 05:12:40 +0000 (+1030) Subject: bfd_nonfatal_message, localise va_start X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd84a8e2e04b397892c5984813837b5e328c41da;p=binutils-gdb.git bfd_nonfatal_message, localise va_start Nothing to see here, just a little tidier. * bucomm.c (bfd_nonfatal_message): Localise va_list args. --- diff --git a/binutils/bucomm.c b/binutils/bucomm.c index 8ce66ab8cce..655bb5d35fb 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -70,7 +70,6 @@ bfd_nonfatal_message (const char *filename, { const char *errmsg; const char *section_name; - va_list args; enum bfd_error err = bfd_get_error (); if (err == bfd_error_no_error) @@ -79,7 +78,6 @@ bfd_nonfatal_message (const char *filename, errmsg = bfd_errmsg (err); fflush (stdout); section_name = NULL; - va_start (args, format); fprintf (stderr, "%s", program_name); if (abfd) @@ -96,11 +94,13 @@ bfd_nonfatal_message (const char *filename, if (format) { + va_list args; + va_start (args, format); fprintf (stderr, ": "); vfprintf (stderr, format, args); + va_end (args); } fprintf (stderr, ": %s\n", errmsg); - va_end (args); } void