From 3b141ba108232294d04adc441306224294847eb9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 27 Jul 2002 02:19:44 +0000 Subject: [PATCH] Fix segfault from ITS#1960 hacks --- libraries/liblunicode/ucdata/ucgendat.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index d4cb97b2de..11f32f9cb2 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -805,9 +805,8 @@ read_cdata(FILE *in) char line[512], *s, *e; lineno = skip = 0; - while (!feof(in)) { - if( !fgets(line, sizeof(line), in)) break; - if( (s=strchr(line, '\n')) ) *s = '\0'; + while (fgets(line, sizeof(line), in)) { + if( (s=strchr(line, '\n')) ) *s = '\0'; lineno++; /* @@ -1165,9 +1164,8 @@ read_compexdata(FILE *in) (void) memset((char *) compexs, 0, sizeof(unsigned long) << 11); - while (!feof(in)) { - if( !fgets(line, sizeof(line), in)) break; - if( (s=strchr(line, '\n')) ) *s = '\0'; + while (fgets(line, sizeof(line), in)) { + if( (s=strchr(line, '\n')) ) *s = '\0'; /* * Skip blank lines and lines that start with a '#'. */ @@ -1272,7 +1270,7 @@ write_cdata(char *opath) /* * Write the header. */ - fwrite((char *) hdr, sizeof(ac_uint4), 2, out); + fwrite((char *) hdr, sizeof(ac_uint2), 2, out); /* * Write the byte count. -- 2.39.5