diff --git a/compel/plugins/std/string.c b/compel/plugins/std/string.c index bde1bc68b..d67e0d1a9 100644 --- a/compel/plugins/std/string.c +++ b/compel/plugins/std/string.c @@ -151,7 +151,12 @@ static unsigned int __conv_val(unsigned char c) if (__isdigit(c)) return c - '0'; else if (__isalpha(c)) - return &conv_tab[__tolower(c)] - conv_tab; + /** + * If we want the value of something which __isalpha() == true + * it has to be base > 10. 'A' = 10, 'B' = 11 ... 'Z' = 35 + */ + return __tolower(c) - 'a' + 10; + return -1u; }