[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] tar.c:237: warning: too few arguments for format
From: |
Jim Meyering |
Subject: |
[Bug-tar] tar.c:237: warning: too few arguments for format |
Date: |
Wed, 08 Feb 2006 20:13:21 +0100 |
FYI, I found it by doing this:
./configure --disable-nls
make CFLAGS='-Wformat -Werror'
Triggering the affected diagnostic makes tar print a lot
of garbage instead of `tar':
$ LC_ALL=POSIX ./tar --quoting-st=3 2>&1 |tr -dc '[[:print:]]\n'
./tar: Unknown quoting style `3'.\
Try `Hl$Ld$HH\$Ll$ILt$L|$H --quoting-style=help' to get a list.
./tar: Error is not recoverable: exiting now
Here's the patch.
I haven't split the diagnostic onto two lines, but
perhaps you should. Certainly, the source line is long
enough to be split.
2006-02-08 Jim Meyering <address@hidden>
* src/tar.c (tar_set_quoting_style): Add program_name argument,
corresponding to unmatched %s in format string.
Index: src/tar.c
===================================================================
RCS file: /cvsroot/tar/tar/src/tar.c,v
retrieving revision 1.139
diff -u -p -r1.139 tar.c
--- src/tar.c 7 Feb 2006 23:51:37 -0000 1.139
+++ src/tar.c 8 Feb 2006 19:11:39 -0000
@@ -235,7 +235,7 @@ tar_set_quoting_style (char *arg)
return;
}
FATAL_ERROR ((0, 0,
- _("Unknown quoting style `%s'. Try `%s --quoting-style=help' to
get a list."), arg));
+ _("Unknown quoting style `%s'. Try `%s --quoting-style=help' to
get a list."), arg, program_name));
}
- [Bug-tar] tar.c:237: warning: too few arguments for format,
Jim Meyering <=