diff options
Diffstat (limited to 'txt.c')
| -rw-r--r-- | txt.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -182,8 +182,9 @@ int txt_save(Txt *t, const char *path) { TxtBuf *b = &t->buf[p->buf]; fwrite(b->s + p->ofs, 1, p->n, f); } + int e = ferror(f); fclose(f); - return ferror(f) ? -1 : 0; + return e ? -1 : 0; } void txt_free(Txt *t) { |
