Removes a clang false positive warning.

This commit is contained in:
Andrea Mazzoleni 2014-02-18 22:46:21 +01:00
parent 4df7961099
commit c6980793a8

6
sync.c
View file

@ -964,10 +964,12 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
struct snapraid_parity* parity_ptr[LEV_MAX];
unsigned unrecoverable_error;
unsigned l;
unsigned level;
int skip_sync = 0;
printf("Initializing...\n");
level = state->level;
blockmax = parity_size(state);
size = blockmax * (data_off_t)state->block_size;
loaded_size = state->loaded_paritymax * (data_off_t)state->block_size;
@ -984,7 +986,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
blockmax = blockstart + blockcount;
}
for(l=0;l<state->level;++l) {
for(l=0;l<level;++l) {
/* create the file and open for writing */
parity_ptr[l] = &parity[l];
ret = parity_create(parity_ptr[l], state->parity_path[l], &out_size, state->opt.skip_sequential);
@ -1044,7 +1046,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
}
}
for(l=0;l<state->level;++l) {
for(l=0;l<level;++l) {
ret = parity_sync(parity_ptr[l]);
if (ret == -1) {
/* LCOV_EXCL_START */