diff options
| author | Mattias Andrée <m@maandree.se> | 2025-12-27 22:42:41 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2025-12-27 22:42:41 +0100 |
| commit | a47384021dfbafe21b90220f1214b529a8502da6 (patch) | |
| tree | 8b0bcc598727c228b099980831825e5ece140ea9 | |
| parent | First commit (diff) | |
| download | luhncheck-1.0.tar.gz luhncheck-1.0.tar.bz2 luhncheck-1.0.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
| -rw-r--r-- | luhncheck.c | 5 |
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'); |
