From 2e5e496eb0936cae7ea8d2b38417feae3ba56881 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 10 Jun 2015 00:48:01 -0400 Subject: Fix overflow warnings Fix new warnings generated by gcc-5 about potential overflows. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/util.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/pacman/util.c') diff --git a/src/pacman/util.c b/src/pacman/util.c index 9fdc39a5..ea7faf80 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1363,13 +1363,12 @@ static int multiselect_parse(char *array, int count, char *response) if(!ends) { array[start - 1] = include; } else { - int d; if(parseindex(ends, &end, start, count) != 0) { return -1; } - for(d = start; d <= end; d++) { - array[d - 1] = include; - } + do { + array[start - 1] = include; + } while(start++ < end); } } -- cgit v1.2.3-24-g4f1b