[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).
This commit is contained in:
Albert Cheng 2009-04-21 18:28:58 -05:00
parent 7d55aa03a2
commit 37906de73c

View File

@ -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"))){