summaryrefslogtreecommitdiffstats
path: root/recipes-extended/diffutils/diffutils-2.8.1/0001-Make-it-build-with-compile-time-hardening-enabled.patch
blob: dc03aa6e5fbeffc26315d502401648a631c637a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 7448c928240aafbfec08a92530a150bc206673bf Mon Sep 17 00:00:00 2001
From: Peter Kjellerstedt <pkj@axis.com>
Date: Thu, 26 Apr 2018 02:40:52 +0200
Subject: [PATCH] Make it build with compile time hardening enabled

This avoids the following error:

  src/diff3.c: In function 'output_diff3':
  src/diff3.c:1405:5: error: format not a string literal and no format
  arguments [-Werror=format-security]
       fprintf (outputfile, line_prefix);
       ^~~~~~~

Upstream-Status: Inappropriate [legacy version]
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 src/diff3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/diff3.c b/src/diff3.c
index f3d3dcf..7237dea 100644
--- a/src/diff3.c
+++ b/src/diff3.c
@@ -1402,7 +1402,7 @@ output_diff3 (FILE *outputfile, struct diff3_block *diff,
 	      line = 0;
 	      do
 		{
-		  fprintf (outputfile, line_prefix);
+		  fprintf (outputfile, "%s", line_prefix);
 		  cp = D_RELNUM (ptr, realfile, line);
 		  length = D_RELLEN (ptr, realfile, line);
 		  fwrite (cp, sizeof (char), length, outputfile);