From 37906de73c0d52a3ae18d4683fa7517cda57c04c Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 21 Apr 2009 18:28:58 -0500 Subject: [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). --- src/H5detect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"))){ -- cgit v0.12