Mail Archives: djgpp-workers/1999/06/14/10:57:08
On Mon, 14 Jun 1999, Eli Zaretskii wrote:
> > On Sun, 13 Jun 1999, Morten Welinder wrote:
> > > It's subtle. If s is a "char *" or "signed char *" and c is an int,
> > > then after "c = *s;", c is -27. isdigit is only defined in the
> > > range -1 to 255. (EOF is -1.)
> Does the following seem okay? It works for me.
It may work, but it's a bit unclear. The cast to (unsigned char) would be
cleaner, I think. Or, for that matter, defining c as an unsigned char
variable straight away.
The rule is simple: a char that is to be passed to a <ctype.h> functions
must either already *be* a unsigned char, or be casted into one.
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -