diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2009-04-21 23:28:58 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2009-04-21 23:28:58 (GMT) |
commit | 37906de73c0d52a3ae18d4683fa7517cda57c04c (patch) | |
tree | bcd7dda1513712a311cea149ef9bc7f86812e977 /src/H5detect.c | |
parent | 7d55aa03a29a2bf5efe0eac7c4505ebf43403975 (diff) | |
download | hdf5-37906de73c0d52a3ae18d4683fa7517cda57c04c.zip hdf5-37906de73c0d52a3ae18d4683fa7517cda57c04c.tar.gz hdf5-37906de73c0d52a3ae18d4683fa7517cda57c04c.tar.bz2 |
[svn-r16829] Bug fix.
In Up (AIX system), the insert_libhdf5_settings() infinite looped because
it never found EOF. Man getc in another system said:
"If the integer value returned by getc() is stored into a variable of
type char and then compared against the integer constant EOF, the com-
parison may never succeed, because sign-extension of a variable of type
char on widening to integer is implementation-defined."
Solution:
Changed inchar from type char to int fixed the problem.
Morale of the story: RTFM or HTCW (heed the compiler warnings).
Tested:
Up (AIX 5.3).
Diffstat (limited to 'src/H5detect.c')
-rw-r--r-- | src/H5detect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/H5detect.c b/src/H5detect.c index 146750c..8d7b93b 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -522,7 +522,7 @@ static void insert_libhdf5_settings(void) { FILE *fsettings; - char inchar; + int inchar; int bol=0; /* indicates the beginning of a new line */ if (NULL==(fsettings=HDfopen(LIBSETTINGSFNAME, "r"))){ |