This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

isprint/isspace segfaulting


Hi all,
Using isprint or isspace is resulting in a segfault. Program attached below.
This on RedHat 9.0, using glibc-common-2.3.2-11.9, glibc-2.3.2-11.9, glibc-devel-2.3.2-11.9,
glibc-kernheaders-2.4-8.10.


PS: In the below program if i declare 'ch' as 'char', then things work fine. Only when it is declared as 'int' does the problem shows up.

Is this expected ?

Thx for any info.

/Raj

-------------Start of program-----------
#include <ctype.h>

int main()
{
        unsigned int ch; //Change this to char or unsigned char.

scanf("%c",&ch);

       if(!isspace(ch)){//isprint also has the same problem
               puts("NO");
       }
       else {
               puts("YES");
       }
}
--------------End of program------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]