bug-gnu-utils
[Top][All Lists]
Advanced

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

avoid warning in diff3.c


From: Jim Meyering
Subject: avoid warning in diff3.c
Date: Sun, 12 Mar 2006 17:13:54 +0100

Here's a tiny patch to avoid this warning:

  diff3.c:1409: warning: format not a string literal and no format arguments

2006-03-12  Jim Meyering  <address@hidden>

        * src/diff3.c (output_diff3): Use fputs in place of fprintf
        to avoid a warning from gcc -Wformat-security.

Index: src/diff3.c
===================================================================
RCS file: /sources/diffutils/diffutils/src/diff3.c,v
retrieving revision 1.45
diff -u -p -r1.45 diff3.c
--- src/diff3.c 5 Jan 2006 07:23:55 -0000       1.45
+++ src/diff3.c 12 Mar 2006 16:09:53 -0000
@@ -1406,7 +1406,7 @@ output_diff3 (FILE *outputfile, struct d
              line = 0;
              do
                {
-                 fprintf (outputfile, line_prefix);
+                 fputs (line_prefix, outputfile);
                  cp = D_RELNUM (ptr, realfile, line);
                  length = D_RELLEN (ptr, realfile, line);
                  fwrite (cp, sizeof (char), length, outputfile);




reply via email to

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