Skip to content

Commit 8fd588f

Browse files
committed
updated for version 7.3.1224
Problem: Clang gives warnings on xxd. Solution: Change how to use part of a string. (Dominique Pelle) Also avoid warning for return not reached.
1 parent 8e79fe2 commit 8fd588f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/regexp_nfa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@ nfa_max_width(startstate, depth)
26112611
if (depth > 4)
26122612
return -1;
26132613

2614-
for (;;)
2614+
while (state != NULL)
26152615
{
26162616
switch (state->c)
26172617
{
@@ -2810,7 +2810,7 @@ nfa_max_width(startstate, depth)
28102810
state = state->out;
28112811
}
28122812

2813-
/* unrecognized */
2813+
/* unrecognized, "cannot happen" */
28142814
return -1;
28152815
}
28162816

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
1224,
731733
/**/
732734
1223,
733735
/**/

src/xxd/xxd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ main(argc, argv)
722722
while ((length < 0 || p < length) && (c = getc(fp)) != EOF)
723723
{
724724
if (fprintf(fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X",
725-
(p % cols) ? ", " : ",\n "+2*!p, c) < 0)
725+
(p % cols) ? ", " : &",\n "[2*!p], c) < 0)
726726
die(3);
727727
p++;
728728
}
@@ -731,7 +731,7 @@ main(argc, argv)
731731

732732
if (p && fputs("\n", fpo) == EOF)
733733
die(3);
734-
if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF)
734+
if (fputs(&"};\n"[3 * (fp == stdin)], fpo) == EOF)
735735
die(3);
736736

737737
if (fp != stdin)

0 commit comments

Comments
 (0)