diff --git a/cmdline/mktest.c b/cmdline/mktest.c index a7eca327..2100ef43 100644 --- a/cmdline/mktest.c +++ b/cmdline/mktest.c @@ -64,7 +64,7 @@ void create_file(const char* path, int size) /* LCOV_EXCL_STOP */ } } else { - /* don't recreate a 0 file to avoid ZERO protection */ + /* don't truncate files to 0 size to avoid ZERO file size protection */ ++size; } @@ -292,6 +292,9 @@ void damage(const char* path, int size) /* LCOV_EXCL_STOP */ } + if (st.st_size == 0) + return; + if (S_ISREG(st.st_mode)) { /* file */ FILE* f;