rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | From 7448c928240aafbfec08a92530a150bc206673bf Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Kjellerstedt <pkj@axis.com> |
| 3 | Date: Thu, 26 Apr 2018 02:40:52 +0200 |
| 4 | Subject: [PATCH] Make it build with compile time hardening enabled |
| 5 | |
| 6 | This avoids the following error: |
| 7 | |
| 8 | src/diff3.c: In function 'output_diff3': |
| 9 | src/diff3.c:1405:5: error: format not a string literal and no format |
| 10 | arguments [-Werror=format-security] |
| 11 | fprintf (outputfile, line_prefix); |
| 12 | ^~~~~~~ |
| 13 | |
| 14 | Upstream-Status: Inappropriate [legacy version] |
| 15 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> |
| 16 | --- |
| 17 | src/diff3.c | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 | |
| 20 | diff --git a/src/diff3.c b/src/diff3.c |
| 21 | index f3d3dcf..7237dea 100644 |
| 22 | --- a/src/diff3.c |
| 23 | +++ b/src/diff3.c |
| 24 | @@ -1402,7 +1402,7 @@ output_diff3 (FILE *outputfile, struct diff3_block *diff, |
| 25 | line = 0; |
| 26 | do |
| 27 | { |
| 28 | - fprintf (outputfile, line_prefix); |
| 29 | + fprintf (outputfile, "%s", line_prefix); |
| 30 | cp = D_RELNUM (ptr, realfile, line); |
| 31 | length = D_RELLEN (ptr, realfile, line); |
| 32 | fwrite (cp, sizeof (char), length, outputfile); |