diff options
Diffstat (limited to 'lib/strtox.c')
-rw-r--r-- | lib/strtox.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/strtox.c b/lib/strtox.c index 45aa06bacc..3bb6b0ef89 100644 --- a/lib/strtox.c +++ b/lib/strtox.c @@ -20,8 +20,8 @@ unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base) if (!base) base = 10; - while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp - '0' : (islower(*cp) - ? toupper(*cp) : *cp) - 'A' + 10) < base) { + while (isxdigit(*cp) && (value = isdigit(*cp) ? + *cp - '0' : toupper(*cp) - 'A' + 10) < base) { result = result * base + value; cp++; } @@ -61,9 +61,8 @@ unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int bas if (!base) base = 10; - while (isxdigit(*cp) && (value = isdigit(*cp) - ? *cp - '0' - : (islower(*cp) ? toupper(*cp) : *cp) - 'A' + 10) < base) { + while (isxdigit(*cp) && (value = isdigit(*cp) ? + *cp - '0' : toupper(*cp) - 'A' + 10) < base) { result = result * base + value; cp++; } |