* [PATCH] tomoyo: Use isdigit() in tomoyo_numscan()
@ 2026-10-14 16:55 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-10-14 16:55 UTC (permalink / raw)
To: Kentaro Takeda, Tetsuo Handa, Paul Moore, James Morris, Serge E. Hallyn
Cc: Thorsten Blum, linux-security-module, linux-kernel
Use isdigit() to replace the open-coded implementation.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
security/tomoyo/common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index fdaeaff01fc1..031c643ce22c 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -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, const
if (!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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-14 16:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 16:55 [PATCH] tomoyo: Use isdigit() in tomoyo_numscan() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®