ed core dumped on blank lines.

This commit is contained in:
cgd 1993-04-10 12:47:09 +00:00
parent bb14fa85f6
commit cd30aed2e6

View File

@ -1544,7 +1544,7 @@ dowrite(n, m, fn, mode)
for (lp = getptr(n); n <= m; n++, lp = lp->next) {
if ((s = gettxt(lp)) == (char *) ERR)
return ERR;
else if ((fputs(s, fp) < 0 || putc('\n', fp) < 0)) {
else if (fputs(strcat(s, "\n"), fp) < 0) {
sprintf(errmsg, "cannot write file");
return ERR;
}