mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
lib: kstrtox: use isdigit() in _parse_integer_limit()
Use isdigit() to replace the open-coded implementation. Link: https://lore.kernel.org/20261013072108.4407-3-blum@kernel.org Signed-off-by: Thorsten Blum <blum@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e062baf568
commit
e60b8f7a1d
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user