This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
isprint/isspace segfaulting
- From: Raj <raju at mailandnews dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: bug-glibc at gnu dot org
- Date: Wed, 10 Dec 2003 11:00:18 +0530
- Subject: 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------------------