aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-12-27 22:42:41 +0100
committerMattias Andrée <m@maandree.se>2025-12-27 22:42:41 +0100
commita47384021dfbafe21b90220f1214b529a8502da6 (patch)
tree8b0bcc598727c228b099980831825e5ece140ea9
parentFirst commit (diff)
downloadluhncheck-master.tar.gz
luhncheck-master.tar.bz2
luhncheck-master.tar.xz
Fix warningsHEAD1.0master
Signed-off-by: Mattias Andrée <m@maandree.se>
-rw-r--r--luhncheck.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/luhncheck.c b/luhncheck.c
index 51f04ab..65315e4 100644
--- a/luhncheck.c
+++ b/luhncheck.c
@@ -9,6 +9,9 @@
NUSAGE(2, "number ...");
+#if defined(__GNUC__)
+__attribute__((__pure__))
+#endif
static int
check_luhn(const char *s)
{
@@ -27,6 +30,8 @@ check_luhn(const char *s)
break;
s++;
+ /* fall through */
+
case 1:
if ('0' <= *s && *s <= '9')
sum += (unsigned)(*s - '0');