mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-22 14:07:07 +02:00
Corrected an apparently non-functional call to feof(); random
end-of-file will now properly terminate instead of re-reading the same line.
This commit is contained in:
+8
-1
@@ -204,8 +204,15 @@ static struct filestack *OpenFiles = NULL;
|
||||
int GetNextLineNoNewline()
|
||||
{
|
||||
char *newbuf;
|
||||
int testc;
|
||||
|
||||
if (feof(infile)) return -1;
|
||||
|
||||
// This is more reliable than feof() ...
|
||||
testc = getc(infile);
|
||||
if (testc == -1) return -1;
|
||||
ungetc(testc, infile);
|
||||
|
||||
if (linesize == 0) {
|
||||
/* Allocate memory for line */
|
||||
linesize = 500;
|
||||
@@ -295,7 +302,7 @@ void SpiceTokNoNewline(void)
|
||||
ungetc(contline, infile);
|
||||
return;
|
||||
}
|
||||
GetNextLineNoNewline();
|
||||
if (GetNextLineNoNewline() == -1) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user