other: disallow unsigned counter ever to have minus value

src/other.c:398:4: runtime error: unsigned integer overflow: 0 - 1 cannot
be represented in type 'unsigned int'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2014-11-14 21:55:17 +00:00
parent 8e076fcc4f
commit 33894fba74

View file

@ -393,9 +393,8 @@ void flip_ranges(struct range_t *restrict flip_me, struct range_t *restrict tmp_
{
unsigned int i = num_ranges - 1, j;
for (j = 0; j < num_ranges; j++) {
for (j = 0; j < num_ranges; j++, i--) {
*(tmp_ranges + j) = *(flip_me + i);
i--;
}
memcpy(flip_me, tmp_ranges, num_ranges * sizeof(struct range_t));