1 From 52093add7b3f38156e632fa81fcf1c0b6ad4d549 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3 Date: Tue, 3 Dec 2013 15:11:14 +0100
4 Subject: [PATCH] Pass compilation with -Wformat-security
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Signed-off-by: Petr Písař <ppisar@redhat.com>
13 src/subr.c | 12 ++++--------
14 3 files changed, 6 insertions(+), 10 deletions(-)
16 diff --git a/diff/diff3.c b/diff/diff3.c
17 index 006039f..e9418ce 100644
20 @@ -1505,7 +1505,7 @@ output_diff3 (diff, mapping, rev_mapping)
24 - printf_output (line_prefix);
25 + printf_output ("%s", line_prefix);
26 cp = D_RELNUM (ptr, realfile, line);
27 length = D_RELLEN (ptr, realfile, line);
28 write_output (cp, length);
29 diff --git a/src/main.c b/src/main.c
30 index 24a6e6f..e7f0439 100644
33 @@ -1154,6 +1154,6 @@ usage (cpp)
35 (void) fprintf (stderr, *cpp++, program_name, cvs_cmd_name);
37 - (void) fprintf (stderr, *cpp);
38 + (void) fprintf (stderr, "%s", *cpp);
41 diff --git a/src/subr.c b/src/subr.c
42 index 0725503..94907ce 100644
45 @@ -46,10 +46,8 @@ xmalloc (bytes)
50 - sprintf (buf, "out of memory; can not allocate %lu bytes",
51 - (unsigned long) bytes);
53 + error (1, 0, "out of memory; can not allocate %lu bytes",
54 + (unsigned long) bytes);
58 @@ -73,10 +71,8 @@ xrealloc (ptr, bytes)
63 - sprintf (buf, "out of memory; can not reallocate %lu bytes",
64 - (unsigned long) bytes);
66 + error (1, 0, "out of memory; can not reallocate %lu bytes",
67 + (unsigned long) bytes);