summaryrefslogtreecommitdiffstats
path: root/src/H5detect.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-04-21 23:29:12 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-04-21 23:29:12 (GMT)
commitb9b28ce4cc8ce8ed29236db7694260da0f1a7a46 (patch)
treef6bb8d863c2185d6e65af30882451b70057f5d33 /src/H5detect.c
parentabd99a6d512461b32dc3b06bbb5ca0afd9090fc1 (diff)
downloadhdf5-b9b28ce4cc8ce8ed29236db7694260da0f1a7a46.zip
hdf5-b9b28ce4cc8ce8ed29236db7694260da0f1a7a46.tar.gz
hdf5-b9b28ce4cc8ce8ed29236db7694260da0f1a7a46.tar.bz2
[svn-r16830] 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.c2
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"))){