From 01852ee90d6c26f507f926f6110ab0a439270366 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 11 Feb 2017 18:20:08 +0000 Subject: [PATCH] isdigit: C99 compatibility -- only check [0-9]. --- src/ctype.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ctype.c b/src/ctype.c index 30edfb93..91aaaff6 100644 --- a/src/ctype.c +++ b/src/ctype.c @@ -73,15 +73,7 @@ int ucd_iscntrl(codepoint_t c) int ucd_isdigit(codepoint_t c) { - switch (ucd_lookup_category(c)) - { - case UCD_CATEGORY_Nd: - case UCD_CATEGORY_Nl: - case UCD_CATEGORY_No: - return 1; - default: - return 0; - } + return (c >= 0x30 && c <= 0x39); // [0-9] } int ucd_isgraph(codepoint_t c)