Skip to content

Commit a40f35f

Browse files
Alexander Gendintrini
Alexander Gendin
authored andcommitted
test: cmd: mbr: Remove unreachable code
Fix an issue reported by Coverity scan, and fix code indentation. Addresses-Coverity-ID: 467404 ("Control flow issues (DEADCODE)") Signed-off-by: Alexander Gendin <[email protected]>
1 parent 4808d16 commit a40f35f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

test/cmd/mbr.c

+7-9
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,14 @@ static unsigned build_mbr_parts(char *buf, size_t buf_size, unsigned num_parts)
205205
bytes_remaining -= cur_str_size;
206206

207207
}
208-
else if (num_parts == 5) {
209-
cur_str_size = sizeof(mbr_parts_p5);
210-
if (cur_str_size + 1 > bytes_remaining)
211-
return 1;
212-
strcat(cur_buf, mbr_parts_p5);
213-
bytes_remaining -= cur_str_size;
208+
else if (num_parts == 5) {
209+
cur_str_size = sizeof(mbr_parts_p5);
210+
if (cur_str_size + 1 > bytes_remaining)
211+
return 1;
212+
strcat(cur_buf, mbr_parts_p5);
213+
bytes_remaining -= cur_str_size;
214214

215-
}
216-
else if (num_parts > 5)
217-
return 1;
215+
}
218216
}
219217
}
220218
}

0 commit comments

Comments
 (0)