diff options
author | KatolaZ <katolaz@freaknet.org> | 2018-04-21 15:32:16 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2018-04-21 15:32:16 +0100 |
commit | 771b998ba5d1f451586aef0562d0012442d6bf23 (patch) | |
tree | 2f1c93699edd48a23d70d3655e35f2961e04c41d /buff.c | |
parent | b10f9522863c937c08d41e2d6da48174cdb3906a (diff) |
Fixed w and f
Diffstat (limited to 'buff.c')
-rw-r--r-- | buff.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -273,3 +273,24 @@ void change_lines(){ addr2 = addr1 =pos; append_lines(); } + + + +int write_lines(){ + FILE *fout; + line_t *l; + int tot=0; + + if (! (fout = fopen(fname, "w+"))){ + return -1; + } + + l = b_start; + while(l){ + tot += fprintf(fout, "%s", l->c); + l = l->next; + } + fclose(fout); + printf("%d\n", tot); + return 0; +} |