From bd84a8e2e04b397892c5984813837b5e328c41da Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 25 Oct 2021 15:42:40 +1030 Subject: [PATCH] bfd_nonfatal_message, localise va_start Nothing to see here, just a little tidier. * bucomm.c (bfd_nonfatal_message): Localise va_list args. --- binutils/bucomm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.30.2