summaryrefslogtreecommitdiff
path: root/src/history.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/history.c')
-rw-r--r--src/history.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/history.c b/src/history.c
index 89a45d3..94d3f75 100644
--- a/src/history.c
+++ b/src/history.c
@@ -79,7 +79,11 @@ struct history history_load()
}
char *buf = xmalloc(len);
- fread(buf, 1, len, histfile);
+ if (fread(buf, 1, len, histfile) != 0) {
+ log_error("Error reading history file: %s.\n", strerror(errno));
+ fclose(histfile);
+ return vec;
+ }
fclose(histfile);
char *saveptr = NULL;