From: Howard Chu Date: Sat, 27 Jul 2002 02:19:44 +0000 (+0000) Subject: Fix segfault from ITS#1960 hacks X-Git-Tag: NO_SLAP_OP_BLOCKS~1315 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3b141ba108232294d04adc441306224294847eb9;p=openldap Fix segfault from ITS#1960 hacks --- 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.