diff options
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; +} |