From 7259718466367874142d3741b027ca36a1fd3552 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 9 Jul 2002 01:00:56 +0000 Subject: [PATCH] ITS#1916: fix fscanf EOF bugs --- libraries/liblunicode/ucdata/ucgendat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index 591fcc4f10..2daee8a4c3 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -804,7 +804,8 @@ read_cdata(FILE *in) char line[512], *s, *e; lineno = skip = 0; - while (fscanf(in, "%[^\n]\n", line) != EOF) { + while (!feof(in)) { + if( fscanf(in, "%[^\n]\n", line) != 1) break; lineno++; /* @@ -1162,7 +1163,8 @@ read_compexdata(FILE *in) (void) memset((char *) compexs, 0, sizeof(unsigned long) << 11); - while (fscanf(in, "%[^\n]\n", line) != EOF) { + while (!feof(in)) { + if( fscanf(in, "%[^\n]\n", line) != 1) break; /* * Skip blank lines and lines that start with a '#'. */ -- 2.39.5