From: | "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx> |
Date: | Thu, 7 Jul 2005 01:51:31 +0200 |
I am not going to cast the argument to an unsigned char, but I am going
to change the macros to work the same way they work in FreeBSD, which
is to say it will test whether the passed value is in the proper range
rather then blindly indexing into an array.
#ifdef __CTYPE_FAST #define VALID_BOUNDS(c) /**/ #else #ifdef __CTYPE_ASSERT #define VALID_BOUNDS(c) assert(c >= -1 && i < 256) #else #define VALID_BOUND(c) if (c != -1) c &= 255; #endif #endif
static __inline int isprint(int c) { VALID_BOUNDS(c); return ((int)((__libc_ctype_ + 1)[c] & _R)); }
cheers simon
-- Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\ Work - Mac +++ space for low $$$ NOW!1 +++ Campaign \ / Party Enjoy Relax | http://dragonflybsd.org Against HTML \ Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
Attachment:
PGP.sig
Description: This is a digitally signed message part