Commit 3b141ba1 authored by Howard Chu's avatar Howard Chu
Browse files

Fix segfault from ITS#1960 hacks

parent b6620f3d
......@@ -805,8 +805,7 @@ read_cdata(FILE *in)
char line[512], *s, *e;
lineno = skip = 0;
while (!feof(in)) {
if( !fgets(line, sizeof(line), in)) break;
while (fgets(line, sizeof(line), in)) {
if( (s=strchr(line, '\n')) ) *s = '\0';
lineno++;
......@@ -1165,8 +1164,7 @@ read_compexdata(FILE *in)
(void) memset((char *) compexs, 0, sizeof(unsigned long) << 11);
while (!feof(in)) {
if( !fgets(line, sizeof(line), in)) break;
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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment