diff options
| author | WormHeamer | 2025-12-28 04:58:35 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-12-28 04:58:35 -0500 |
| commit | 5c903e08600ee2c65ea24c3c8b4ef2a12db2afbd (patch) | |
| tree | c7c325bd80e8c371db361786d21fcde60bf55681 /txt.c | |
| parent | a46d0a0d3682d32b8eb63c9a10e53ef80920c7b1 (diff) | |
ferror in the right place
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) { |
