This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: isprint/isspace segfaulting
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Raj <raju at mailandnews dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 09 Dec 2003 22:15:22 -0800
- Subject: Re: isprint/isspace segfaulting
- Organization: Red Hat, Inc.
- References: <3FD6AF6A.3020509@mailandnews.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Raj wrote:
> 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 ?
Why would you expect the program to work? You pass a partially
initialized value to isspace. Three of the four bytes are
uninitialized, and which depends on the endianess.
- --
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/1rn62ijCOnn/RHQRAhbNAJ9AGZcKwGDBHENgi9XJGndzAaCYVQCgg7Fl
yU6SFO2sLfW8wpm+Xg7WOTo=
=zB+v
-----END PGP SIGNATURE-----