aboutsummaryrefslogtreecommitdiff
path: root/osc.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-25 16:54:21 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-25 16:54:21 +0000
commit777a2eac51d7355ec9f4107725dcb45070ad5be0 (patch)
tree5020a87e1e656e3b517c14150825888d649a9461 /osc.c
parentMerge branch 'message-fix' into master (diff)
parentmeson/pkgbuild: bump tllist requirement to 1.0.4 (diff)
Merge branch 'pedantic' into master
Diffstat (limited to 'osc.c')
-rw-r--r--osc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/osc.c b/osc.c
index 20ceda8e..dcfaf524 100644
--- a/osc.c
+++ b/osc.c
@@ -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);