diff options
author | Michael Brown | 2008-05-19 17:34:17 +0200 |
---|---|---|
committer | Michael Brown | 2008-05-19 17:34:17 +0200 |
commit | 7d01bf663eb79106ed3fa0a708c36dd10f913697 (patch) | |
tree | 2ea0c11171b90e786c89b4247d581ca52e40a053 /src/include/ctype.h | |
parent | [tg3] Add support for tg3-5721 (diff) | |
download | ipxe-7d01bf663eb79106ed3fa0a708c36dd10f913697.tar.gz ipxe-7d01bf663eb79106ed3fa0a708c36dd10f913697.tar.xz ipxe-7d01bf663eb79106ed3fa0a708c36dd10f913697.zip |
[libc] Fix isdigit(), islower() and isupper().
From: Stefan Hajnoczi <stefanha@gmail.com>
Diffstat (limited to 'src/include/ctype.h')
-rw-r--r-- | src/include/ctype.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/include/ctype.h b/src/include/ctype.h index a79395d2..7740443d 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) { |