tomoyo: Use isdigit() in tomoyo_numscan()
Subsystems (2)
PATCH 1/1 tomoyo: Use isdigit() in tomoyo_numscan()
Use isdigit() to replace the open-coded implementation.
Signed-off-by Thorsten Blum <[email protected]>
--- security/tomoyo/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/tomoyo/common.c +2 -1
@@ -5,6 +5,7 @@* Copyright (C) 2005-2011 NTT DATA CORPORATION */ +#include <linux/ctype.h> #include <linux/uaccess.h> #include <linux/slab.h> #include <linux/security.h>
@@ -2030,7 +2031,7 @@ static bool tomoyo_numscan(const char *str, const char *head, int *width, constif (!strncmp (str, head, n)) { cp = str + n; -while (*cp && *cp >='0' && *cp <='9' ) +while (*cp &&isdigit (*cp)) cp++;if (*cp == tail || !tail) { *width = cp - (str + n);
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 3 lines
Use
isdigit()to replace the open-coded implementation.Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 7 lines · Thorsten Blum
Use
isdigit()to replace the open-coded implementation.Signed-off-by Thorsten Blum <[email protected]>--- security/tomoyo/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by Paul Moore <[email protected]>
Signature · 1 line
paul-moore.com