Skip to contentSkip to conversation

lib: kstrtox: Use isdigit() in _parse_integer_limit()

PATCH Applied Thorsten Blum 1 participant 1 message Oct 13 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: kstrtox: Use isdigit() in _parse_integer_limit()

Use isdigit() to replace the open-coded implementation.

---
 lib/kstrtox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kstrtox.c +1 -1
index bac1c057e1b0..1b3f0d3fff37 100644
@@ -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;