DragonFly BSD
DragonFly commits List (threaded) for 2005-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: ctype bug


From: Jonas Trollvik <jontro@xxxxxxxxx>
Date: Wed, 6 Jul 2005 15:28:54 +0200

how come the argument to isprint is an int and not an unsigned char?
to me it doesnt make sense at all.

On 7/6/05, Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx> wrote:
> On Tue, Jul 05, 2005 at 11:20:24PM -0700, Matthew Dillon wrote:
> >     Whoops, we have a problem with the ctype code... it is not properly
> >     folding negative integers (i.e. when a signed char is passed to
> >     an is*() function).
> 
> That's a bug in the test case, not in the ctype functions. You MUST pass
> unsigned char values to it, NOT signed char. Actually, that code might core
> dump. The only valid exception is EOF (-1).
> 
> Joerg
>




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