Skip to content

Commit

Permalink
fix some implicit fallthroughs
Browse files Browse the repository at this point in the history
  • Loading branch information
q66 committed Jul 14, 2024
1 parent 0a269a1 commit dac8dd3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
28 changes: 27 additions & 1 deletion patches/src.freebsd.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9867,7 +9867,19 @@
#include <capsicum_helpers.h>
#include <ctype.h>
#include <err.h>
@@ -319,8 +320,11 @@
@@ -198,9 +199,11 @@
break;
case 0:
usage();
+ break;
default:
errx(1, "too many arguments. What do you mean by %s?",
argv[4]);
+ break;
}
getformat();

@@ -319,8 +322,11 @@
for (i = 1; i <= reps || infinity; i++) {
if (use_random)
y = random() / divisor;
Expand All @@ -9881,6 +9893,20 @@
if (putdata(y * x + begin, !(reps - i)))
errx(1, "range error in conversion");
}
@@ -493,11 +499,12 @@
case 'f': case 'e': case 'g': case 'E': case 'G':
if (!longdata)
break;
- /* FALLTHROUGH */
+ goto fmt_broken;
default:
fmt_broken:
*++p = '\0';
errx(1, "illegal or unsupported format '%s'", p2);
+ break;
/* NOTREACHED */
}
while (*++p)
--- src.orig/libfetch/common.c
+++ src.freebsd/libfetch/common.c
@@ -135,10 +135,7 @@
Expand Down
5 changes: 4 additions & 1 deletion src.freebsd/jot/jot.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ main(int argc, char **argv)
break;
case 0:
usage();
break;
default:
errx(1, "too many arguments. What do you mean by %s?",
argv[4]);
break;
}
getformat();

Expand Down Expand Up @@ -497,11 +499,12 @@ getformat(void)
case 'f': case 'e': case 'g': case 'E': case 'G':
if (!longdata)
break;
/* FALLTHROUGH */
goto fmt_broken;
default:
fmt_broken:
*++p = '\0';
errx(1, "illegal or unsupported format '%s'", p2);
break;
/* NOTREACHED */
}
while (*++p)
Expand Down

0 comments on commit dac8dd3

Please sign in to comment.