Remove warnings when building with low optimizations

This commit is contained in:
Andrea Mazzoleni 2015-12-20 17:23:58 +01:00
parent 584c362ba4
commit c80fd07058
2 changed files with 6 additions and 3 deletions

View file

@ -924,14 +924,16 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
pathcpy(state->parity[level].smartctl, sizeof(state->parity[level].smartctl), custom);
} else {
/* search the disk */
struct snapraid_disk* disk;
/* search the disk */
disk = 0;
for (i = state->disklist; i != 0; i = i->next) {
disk = i->data;
if (strcmp(disk->name, buffer) == 0)
break;
}
if (!i) {
if (!disk) {
/* LCOV_EXCL_START */
log_fatal("Missing disk smartctl '%s' at line %u\n", buffer, line);
exit(EXIT_FAILURE);