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

ctype bug


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 5 Jul 2005 23:20:24 -0700 (PDT)

    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).

    The is*() functions are returning non-zero for all negative numbers,
    which is wrong.

						-Matt

main()
{
    int c;

    for (c = -128; c < 256; ++c) {
        if (isprint(c))
            printf("%02x %c\n", (unsigned char)c, c);
    }
    return(0);
}





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