summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ratox.c b/ratox.c
index 0523088..fd3504c 100644
--- a/ratox.c
+++ b/ratox.c
@@ -588,6 +588,12 @@ dataload(void)
sz = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
+ if (sz == 0) {
+ fprintf(stderr, "%s seems to be corrupt\n",
+ DATAFILE);
+ exit(EXIT_FAILURE);
+ }
+
data = malloc(sz);
if (!data) {
perror("malloc");