mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
lib: kstrtox: use isdigit() in _parse_integer_limit()
Use isdigit() to replace the open-coded implementation. Link: https://lore.kernel.org/[email protected] Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Andrew Morton <[email protected]>
This commit is contained in:
committed by
Andrew Morton
parent
e062baf568
commit
e60b8f7a1d
+1
-1
@@ -69,7 +69,7 @@ unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned lon
|
||||
unsigned int lc = _tolower(c);
|
||||
unsigned int val;
|
||||
|
||||
if ('0' <= c && c <= '9')
|
||||
if (isdigit(c))
|
||||
val = c - '0';
|
||||
else if ('a' <= lc && lc <= 'f')
|
||||
val = lc - 'a' + 10;
|
||||
|
||||
Reference in New Issue
Block a user