files: check also for write errors when prepending, not just read errors

master
Benno Schulenberg 2017-04-04 12:21:43 +02:00
parent 70bcf752dc
commit 0abf225129
1 changed files with 1 additions and 1 deletions

View File

@ -1979,7 +1979,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
goto cleanup_and_exit;
}
if (copy_file(f_source, f, TRUE) == -1) {
if (copy_file(f_source, f, TRUE) != 0) {
statusline(ALERT, _("Error writing %s: %s"), realname,
strerror(errno));
goto cleanup_and_exit;