From 7d01bf663eb79106ed3fa0a708c36dd10f913697 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 19 May 2008 16:34:17 +0100 Subject: [libc] Fix isdigit(), islower() and isupper(). From: Stefan Hajnoczi --- src/include/ctype.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/ctype.h b/src/include/ctype.h index a79395d2a..7740443d9 100644 --- a/src/include/ctype.h +++ b/src/include/ctype.h @@ -6,10 +6,9 @@ * Character types */ -#define isdigit(c) ((c & 0x04) != 0) -#define islower(c) ((c & 0x02) != 0) -//#define isspace(c) ((c & 0x20) != 0) -#define isupper(c) ((c & 0x01) != 0) +#define isdigit(c) ((c) >= '0' && (c) <= '9') +#define islower(c) ((c) >= 'a' && (c) <= 'z') +#define isupper(c) ((c) >= 'A' && (c) <= 'Z') static inline unsigned char tolower(unsigned char c) { -- cgit v1.2.3-55-g7522