diff options
| -rw-r--r-- | src/alf.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -263,9 +263,16 @@ void crunch_file(const char *filename) { /* read in entire input, couldn't do it this way on the Atari */ input_len = fread(input_buf, 1, MAX_INPUT_SIZE - 1, in_file); + if(!feof(in_file)) { - fprintf(stderr, "%s: this file is too large; only compressing the first 16MB.\n", self); + fprintf(stderr, "%s: %s: this file is too large; only compressing the first 16MB.\n", self, filename); + } + + if(!input_len) { + fprintf(stderr, "%s: %s: can't compress a 0-byte (empty) file, skipping.\n", self, filename); + return; } + output_len = 0; fstat(fileno(in_file), &in_file_stat); /* for timestamp */ fclose(in_file); |
