diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-08-25 16:54:21 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-08-25 16:54:21 +0000 |
| commit | 777a2eac51d7355ec9f4107725dcb45070ad5be0 (patch) | |
| tree | 5020a87e1e656e3b517c14150825888d649a9461 /osc.c | |
| parent | Merge branch 'message-fix' into master (diff) | |
| parent | meson/pkgbuild: bump tllist requirement to 1.0.4 (diff) | |
Merge branch 'pedantic' into master
Diffstat (limited to 'osc.c')
| -rw-r--r-- | osc.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -339,9 +339,15 @@ static uint8_t nibble2hex(char c) { switch (c) { - case '0' ... '9': return c - '0'; - case 'a' ... 'f': return c - 'a' + 10; - case 'A' ... 'F': return c - 'A' + 10; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return c - '0'; + + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + return c - 'a' + 10; + + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + return c - 'A' + 10; } assert(false); |
