Commit 89c8637d authored by Garry R. Osgood's avatar Garry R. Osgood Committed by Garry R. Osgood
Browse files

*app/docindex.c Used feof(fp) as a hardware independent indicator,

2000-05-20  Garry R. Osgood <gosgood@idt.net>
*app/docindex.c
Used feof(fp) as a hardware independent indicator, replacing
constructs comparing EOF (-1) to integers that once were unsigned
characters. Puts an end to infinite looping at line 239 giving rise to
#11578. See bug report; closes 11578.
parent a82a3cf5
2000-05-20 Garry R. Osgood <gosgood@idt.net>
*app/docindex.c
Beware "int a; a = fgetc(fp); ... if(a == EOF)." for fgetc()
is advertised to get the next "unsigned character converted
to an integer..." a non-negative on SGI, in particular the end-of-file
return value '\377' promotes to integer 255 and this is not
the same as EOF as defined in SGI's stdio.h:145:# define EOF (-1).
feof(fp) returns a hardware independent indicator, so this construct
was put in place instead. Put an end to infinite looping at line 239
(because end of file was not being recognized everywhere)
giving rise to #11578. See bug report; closes 11578.
2000-05-20 Sven Neumann <sven@gimp.org>
* plug-ins/webbrowser/web-browser.scm: added links to
......
......@@ -539,7 +539,8 @@ getinteger (FILE *fp)
for (; isspace (nextchar); nextchar = fgetc (fp))
/* empty statement */ ;
ungetc (nextchar, fp);
if (!feof(fp))
ungetc (nextchar, fp);
if (negative)
response = -response;
......@@ -554,7 +555,7 @@ clear_white (FILE *fp)
while (isspace (nextchar = fgetc (fp)))
/* empty statement */ ;
if (nextchar != EOF)
if (!feof(fp))
ungetc (nextchar, fp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment