Fix an incorrect hex parser 87/245787/1
authorMichal Bloch <m.bloch@samsung.com>
Thu, 15 Oct 2020 17:30:54 +0000 (19:30 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Thu, 15 Oct 2020 17:30:59 +0000 (19:30 +0200)
Uppercase digits were incorrectly being found by the lowercase conditional.

Change-Id: If2c5de30a9f06248b525e78a236219b254eb594e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/os-linux.h

index 3976b38..a158b99 100644 (file)
@@ -120,10 +120,10 @@ scan_hex (char *cp, unsigned long *valp)
       digit = *cp;
       if ((digit - '0') <= 9)
         digit -= '0';
-      else if ((digit - 'a') < 6)
-        digit -= 'a' - 10;
       else if ((digit - 'A') < 6)
         digit -= 'A' - 10;
+      else if ((digit - 'a') < 6)
+        digit -= 'a' - 10;
       else
         break;
       val = (val << 4) | digit;