diff options
author | David Crosby <dave@dafyddcrosby.com> | 2015-07-26 04:20:39 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2015-08-11 12:59:27 +0000 |
commit | 426e8b3799be260193150c5c0a8d7cbc41d7bf03 (patch) | |
tree | 3002d0e8e6e70ba6184b63ac4a738cd051884c7c /history.c | |
parent | Adjust while loop (diff) | |
download | w3m-426e8b3799be260193150c5c0a8d7cbc41d7bf03.tar.gz w3m-426e8b3799be260193150c5c0a8d7cbc41d7bf03.zip |
Check return value of rename
Diffstat (limited to 'history.c')
-rw-r--r-- | history.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -60,6 +60,7 @@ saveHistory(Hist *hist, size_t size) FILE *f; HistItem *item; char *tmpf; + int rename_ret; if (hist == NULL || hist->list == NULL) return; @@ -79,7 +80,11 @@ saveHistory(Hist *hist, size_t size) disp_err_message("Can't save history", FALSE); return; } - rename(tmpf, rcFile(HISTORY_FILE)); + rename_ret = rename(tmpf, rcFile(HISTORY_FILE)); + if (rename_ret != 0) { + disp_err_message("Can't save history", FALSE); + return; + } } #endif /* USE_HISTORY */ |