support lower and upper case hex chars
[librfid] / utils / common.c
index ec7fda0..ba39710 100644 (file)
@@ -43,6 +43,8 @@ static char parse_hexdigit(const char hexdigit)
                return hexdigit - '0';
        if (hexdigit <= 'f' && hexdigit >= 'a')
                return 10 + (hexdigit - 'a');
+       if (hexdigit <= 'F' && hexdigit >= 'A')
+               return 10 + (hexdigit - 'A');
 
        return 0;
 }