Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH] tomoyo: Use isdigit() in tomoyo_numscan()
@ 2026-10-14 16:55 Thorsten Blum
  2026-10-14 16:59 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages 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 related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-14 16:59 UTC | newest]

Thread overview: 2+ messages (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
2026-10-14 16:59 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox