wok-next view cvs/stuff/patches/cvs-1.11.23-Pass-compilation-with-Wformat-security.patch @ rev 21105

Small updates... "bzip2" and "cairo": follow "libpkg - pkg - pkg-dev" rule
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Jan 04 17:29:48 2019 +0200 (2019-01-04)
parents
children
line source
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
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Signed-off-by: Petr Písař <ppisar@redhat.com>
10 ---
11 diff/diff3.c | 2 +-
12 src/main.c | 2 +-
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
18 --- a/diff/diff3.c
19 +++ b/diff/diff3.c
20 @@ -1505,7 +1505,7 @@ output_diff3 (diff, mapping, rev_mapping)
21 line = 0;
22 do
23 {
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
31 --- a/src/main.c
32 +++ b/src/main.c
33 @@ -1154,6 +1154,6 @@ usage (cpp)
34 {
35 (void) fprintf (stderr, *cpp++, program_name, cvs_cmd_name);
36 for (; *cpp; cpp++)
37 - (void) fprintf (stderr, *cpp);
38 + (void) fprintf (stderr, "%s", *cpp);
39 error_exit ();
40 }
41 diff --git a/src/subr.c b/src/subr.c
42 index 0725503..94907ce 100644
43 --- a/src/subr.c
44 +++ b/src/subr.c
45 @@ -46,10 +46,8 @@ xmalloc (bytes)
46 cp = malloc (bytes);
47 if (cp == NULL)
48 {
49 - char buf[80];
50 - sprintf (buf, "out of memory; can not allocate %lu bytes",
51 - (unsigned long) bytes);
52 - error (1, 0, buf);
53 + error (1, 0, "out of memory; can not allocate %lu bytes",
54 + (unsigned long) bytes);
55 }
56 return (cp);
57 }
58 @@ -73,10 +71,8 @@ xrealloc (ptr, bytes)
60 if (cp == NULL)
61 {
62 - char buf[80];
63 - sprintf (buf, "out of memory; can not reallocate %lu bytes",
64 - (unsigned long) bytes);
65 - error (1, 0, buf);
66 + error (1, 0, "out of memory; can not reallocate %lu bytes",
67 + (unsigned long) bytes);
68 }
69 return (cp);
70 }
71 --
72 1.8.3.1