Mail Archives: djgpp/1997/05/09/15:47:29
John M. Aldrich wrote:
> In DJGPP, the ctype functions evaluate to a lookup of an array of
> flags. You are perfectly safe to call them with any valid char value.
Right. I should point out that the ctype.h is... functions take an int,
but the ANSI C standard (7.3, Character handling <ctype.h>) states that
it's only valid to call them with an unsigned char value or EOF.
So if you call isspace(-2) or isspace(23523), you're likely to have a
problem -- this is because, as you say, the ctype functions are
implemented as a lookup table, and looking up something other than -1 ..
255 would be a bad thing.
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"The future / is right there."
/ Bill Moyers
- Raw text -