diff options
author | sin <sin@2f30.org> | 2014-09-23 10:56:00 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-09-23 10:56:00 +0100 |
commit | f057ea6ebc1f7daa848e82b24de1f3f181d19cc0 (patch) | |
tree | ee579d0efc3fa7b12527272320ffb23bb5d2db1e | |
parent | 24f7db2f674741749c89fb666708c53e1cbe54d4 (diff) |
Scream if the datafile has 0 length
-rw-r--r-- | ratox.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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"); |