ed: Use fwrite to write lines instead of fputs
We already have the length of the line, so there is no point in recalculating it before printing.
This commit is contained in:
parent
714601b29d
commit
a139474486
2
ed.c
2
ed.c
@ -633,7 +633,7 @@ dowrite(const char *fname, int trunc)
|
|||||||
for (i = line1; i <= line2; ++i) {
|
for (i = line1; i <= line2; ++i) {
|
||||||
gettxt(i);
|
gettxt(i);
|
||||||
bytecount += text.siz - 1;
|
bytecount += text.siz - 1;
|
||||||
fputs(text.str, fp);
|
fwrite(text.str, 1, text.siz - 1, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
curln = line2;
|
curln = line2;
|
||||||
|
Loading…
Reference in New Issue
Block a user