From: Kurt Zeilenga Date: Tue, 9 Jul 2002 01:00:56 +0000 (+0000) Subject: ITS#1916: fix fscanf EOF bugs X-Git-Tag: NO_SLAP_OP_BLOCKS~1378 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7259718466367874142d3741b027ca36a1fd3552;p=openldap ITS#1916: fix fscanf EOF bugs --- 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 '#'. */