diff options
author | 2018-07-10 17:45:52 +0000 | |
---|---|---|
committer | 2018-07-10 17:45:52 +0000 | |
commit | 0971b67f68eabe84e58ba202abe73d50c878d1ac (patch) | |
tree | b15e774a68a10234788ba9c13aac96e9df7b23cf /gnu/usr.bin/cvs/diff/diff3.c | |
parent | Make legacy interrupts work in acpipci(4). (diff) | |
download | wireguard-openbsd-0971b67f68eabe84e58ba202abe73d50c878d1ac.tar.xz wireguard-openbsd-0971b67f68eabe84e58ba202abe73d50c878d1ac.zip |
Fix a few, but not all, clang warnings: Use "%s" to print modifiable
strings, add a couple of braces, ansify a few functions, add and remove
a few extra parens.
ok jcs
Diffstat (limited to 'gnu/usr.bin/cvs/diff/diff3.c')
-rw-r--r-- | gnu/usr.bin/cvs/diff/diff3.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gnu/usr.bin/cvs/diff/diff3.c b/gnu/usr.bin/cvs/diff/diff3.c index 4a6fba618c2..10903fa2e29 100644 --- a/gnu/usr.bin/cvs/diff/diff3.c +++ b/gnu/usr.bin/cvs/diff/diff3.c @@ -1502,7 +1502,7 @@ output_diff3 (diff, mapping, rev_mapping) line = 0; do { - printf_output (line_prefix); + printf_output ("%s", line_prefix); cp = D_RELNUM (ptr, realfile, line); length = D_RELLEN (ptr, realfile, line); write_output (cp, length); @@ -1554,11 +1554,12 @@ undotlines (leading_dot, start, num) int leading_dot, start, num; { write_output (".\n", 2); - if (leading_dot) + if (leading_dot) { if (num == 1) printf_output ("%ds/^\\.//\n", start); else printf_output ("%d,%ds/^\\.//\n", start, start + num - 1); + } } /* @@ -1749,11 +1750,12 @@ output_diff3_merge (infile, diff, mapping, rev_mapping, do { c = getc (infile); - if (c == EOF) + if (c == EOF) { if (ferror (infile)) diff3_perror_with_exit ("input file"); else if (feof (infile)) diff3_fatal ("input file shrank"); + } cc = c; write_output (&cc, 1); } @@ -1803,7 +1805,7 @@ output_diff3_merge (infile, diff, mapping, rev_mapping, linesread += i; while (0 <= --i) while ((c = getc (infile)) != '\n') - if (c == EOF) + if (c == EOF) { if (ferror (infile)) diff3_perror_with_exit ("input file"); else if (feof (infile)) @@ -1812,6 +1814,7 @@ output_diff3_merge (infile, diff, mapping, rev_mapping, diff3_fatal ("input file shrank"); return conflicts_found; } + } } /* Copy rest of common file. */ while ((c = getc (infile)) != EOF || !(ferror (infile) | feof (infile))) |