Silence clang static analyzer warnings

This commit is contained in:
Andrea Mazzoleni 2026-07-30 12:40:08 +02:00
parent 76124cff00
commit 3878c0e2e6
10 changed files with 35 additions and 19 deletions

View file

@ -329,7 +329,9 @@ static int repair(struct snapraid_state* state, int rehash, block_off_t pos, uns
/* LCOV_EXCL_STOP */
}
if (hash_is_invalid(block->hash)) {
if (block == BLOCK_NULL) {
hash = "none";
} else if (hash_is_invalid(block->hash)) {
hash = "lost";
} else if (hash_is_zero(block->hash)) {
hash = "zero";