mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Avoids possible division by zero in the regression test.
This commit is contained in:
parent
8912ebd76d
commit
2a6ad5d1ff
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue