summaryrefslogtreecommitdiff
path: root/txt.c
diff options
context:
space:
mode:
Diffstat (limited to 'txt.c')
-rw-r--r--txt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/txt.c b/txt.c
index 9046b79..0b13a9e 100644
--- a/txt.c
+++ b/txt.c
@@ -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) {