Skip to contentSkip to conversation

accessibility: speakup: Use isdigit() in handle_goto()

PATCH In review Thorsten Blum 2 participants 2 messages Oct 12 Speakup console speech driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accessibility: speakup: Use isdigit() in handle_goto()

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

---
 drivers/accessibility/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accessibility/speakup/main.c +1 -1
index e9b7c2761f6f..a7c14531f2ce 100644
@@ -1980,7 +1980,7 @@ static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u16 key)
 	maxlen = (*goto_buf >= '0') ? 3 : 4;
 	if ((ch == '+' || ch == '-') && num == 1)
 		return 1;
-	if (ch >= '0' && ch <= '9' && num < maxlen)
+	if (isdigit(ch) && num < maxlen)
 		return 1;
 	if (num < maxlen - 1 || num > maxlen)
 		goto oops;
maintainer Reviewed-by on v1 1/1
#1 lore raw

Thorsten Blum, le lun. 12 oct. 2026 15:08:05 +0200, a ecrit:

Quoted 3 lines

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

Thanks!

Quoted 18 lines
---
 drivers/accessibility/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accessibility/speakup/main.c +1 -1
index e9b7c2761f6f..a7c14531f2ce 100644
@@ -1980,7 +1980,7 @@ static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u16 key)
 	maxlen = (*goto_buf >= '0') ? 3 : 4;
 	if ((ch == '+' || ch == '-') && num == 1)
 		return 1;
-	if (ch >= '0' && ch <= '9' && num < maxlen)
+	if (isdigit(ch) && num < maxlen)
 		return 1;
 	if (num < maxlen - 1 || num > maxlen)
 		goto oops;