aboutsummaryrefslogtreecommitdiff
path: root/src/alf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alf.c')
-rw-r--r--src/alf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/alf.c b/src/alf.c
index f77f8ad..bc38dd0 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -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);