[patch] actsync rejects hannover._wichtig
Russ Allbery
rra at stanford.edu
Thu Mar 18 20:32:25 UTC 2010
Julien ÉLIE <julien at trigofacile.com> writes:
> Hmm... I read in our include/clibrary.h:
> /* On some systems, the macros defined by <ctype.h> are only valid on ASCII
> characters (those characters that isascii() says are ASCII). This comes
> into play when applying <ctype.h> macros to eight-bit data. autoconf
> checks for this with as part of AC_HEADER_STDC, so if autoconf doesn't
> think our headers are standard, check isascii() first. */
> #if STDC_HEADERS
> # define CTYPE(isXXXXX, c) (isXXXXX((unsigned char)(c)))
> #else
> # define CTYPE(isXXXXX, c) \
> (isascii((unsigned char)(c)) && isXXXXX((unsigned char)(c)))
> #endif
> Is that behaviour still true today?
You can safely assume that STDC_HEADERS is always true and rip out any
code in INN that only applies if it's false. SunOS is dead.
> Another question: is our isXXXXX() really working?!?
> Shouldn't we put several lines for isdigit(), isalnum(), etc.?
The above code does work, through the magic of scary C preprocessor fun,
in the places that use it, but there's no reason at this point not to go
through and replace any instance of CTYPE(isfoo, c) with
isfoo((unsigned char) c). Be sure to add the cast, though; it remains the
case that passing signed characters into is*() functions can cause
problems on some platforms. Some implementations do straight table
lookups and, if given what they think is a negative number, will happily
dereference memory off the beginning of the table.
--
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
Please send questions to the list rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
More information about the inn-workers
mailing list