mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
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:
parent
8e076fcc4f
commit
33894fba74
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
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);
|
*(tmp_ranges + j) = *(flip_me + i);
|
||||||
i--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(flip_me, tmp_ranges, num_ranges * sizeof(struct range_t));
|
memcpy(flip_me, tmp_ranges, num_ranges * sizeof(struct range_t));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue