[PATCH] ppc/xmon: use isxdigit/isspace/isalnum from ctype.h
Vincent Bernat
vincent at bernat.im
Tue Jul 15 19:38:51 EST 2014
❦ 15 juillet 2014 08:55 GMT, David Laight <David.Laight at ACULAB.COM> :
>> Use linux/ctype.h instead of defining custom versions of
>> isxdigit/isspace/isalnum.
>
> ...
>> -#define isspace(c) (c == ' ' || c == '\t' || c == 10 || c == 13 || c == 0)
>
> That is different from the version in linux/ctype.h
> Especially for 'c == 0', but probably also vertical tab and form feed.
OK. Looking more carefully, the one in ctype.h is 9-13 (11 is vertical
tab, 12 is form feed), 32 and 160 (non-breaking space, not ASCII).
For isxdigit, this is the same. For isalnum, the one in ctype.h does
accept non ASCII chars from 223.
Also, in xmon.c, isxdigit is defined twice.
--
Parenthesise to avoid ambiguity.
- The Elements of Programming Style (Kernighan & Plauger)
More information about the Linuxppc-dev
mailing list