summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libshouldbeinlibc/argp-help.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libshouldbeinlibc/argp-help.c b/libshouldbeinlibc/argp-help.c
index 96a020c8..5c9907f0 100644
--- a/libshouldbeinlibc/argp-help.c
+++ b/libshouldbeinlibc/argp-help.c
@@ -871,15 +871,19 @@ argp_failure (struct argp_state *state, int status, int errnum,
if (stream)
{
- va_list ap;
-
fputs (state ? state->name : program_invocation_name, stream);
- putc (':', stream);
- putc (' ', stream);
- va_start (ap, fmt);
- vfprintf (stream, fmt, ap);
- va_end (ap);
+ if (fmt)
+ {
+ va_list ap;
+
+ putc (':', stream);
+ putc (' ', stream);
+
+ va_start (ap, fmt);
+ vfprintf (stream, fmt, ap);
+ va_end (ap);
+ }
if (errnum)
{