bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: international alnum characters not part of words even with locale se


From: Oskar Liljeblad
Subject: Re: international alnum characters not part of words even with locale set
Date: Mon, 6 Jan 2003 13:45:51 +0100
User-agent: Mutt/1.4i

On Thursday, January 02, 2003 at 10:34, Chet Ramey wrote:
[..]
> >   #define NON_NEGATIVE(c) (_rl_meta_flag || (unsigned char)(c) == (c))
> > 
> > (I haven't tested it though.)
> 
> The intent of NON_NEGATIVE is to prevent buffer overflows and potential
> core dumps with the ctype.h macros.
> 
> Consider a system where chars are signed, and the is* ctype.h macros are
> implemented using table lookups.  isprint('\200') is therefore equivalent
> to isprint(-128), which is undefined and will potentially cause a core
> dump.
[..]
> Your patch, while it may solve your particular problem, re-exposes the
> problem NON_NEGATIVE was intended to solve.

Ok, I see now the reason for NON_NEGATIVE.

But surely it must be possible to write a simple test in configure.in
to see if these ctype functions can handle (char)x where 128 <= x <= 255.

Oskar (oskar@osk.mine.nu)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]