bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] tar-1.14: names.c: minor patch to avoid warning


From: Jim Meyering
Subject: [Bug-tar] tar-1.14: names.c: minor patch to avoid warning
Date: Tue, 11 May 2004 15:28:32 +0200

Thanks for maintaining GNU tar.
I noticed this warning when compiling with gcc's -Wformat-security option:

  names.c:1070: warning: format not a string literal and no format arguments

Here's a patch to avoid it:

2004-05-11  Jim Meyering  <address@hidden>

        * src/names.c (safer_name_suffix): Use "%s" as the format
        argument, rather than a possibly-translated variable string.

--- src/names.c.~1~     2004-05-11 15:19:55.153540663 +0200
+++ src/names.c 2004-05-11 15:20:01.242376029 +0200
@@ -1067,7 +1067,7 @@ safer_name_suffix (char const *file_name
            N_("Substituting `.' for empty member name"),
            N_("Substituting `.' for empty hard link target")
          };
-         WARN ((0, 0, _(diagnostic[link_target])));
+         WARN ((0, 0, "%s", _(diagnostic[link_target])));
        }
 
       p = ".";





reply via email to

[Prev in Thread] Current Thread [Next in Thread]