summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-06-10 06:48:01 +0200
committerAllan McRae <allan@archlinux.org>2015-07-12 08:23:18 +0200
commit2e5e496eb0936cae7ea8d2b38417feae3ba56881 (patch)
tree9f1e481e36523953fa8cdcf0e1c343171033a321 /src/pacman/util.c
parenta187fa4562dc2f43f10134092056c2a9a6862d59 (diff)
downloadpacman-2e5e496eb0936cae7ea8d2b38417feae3ba56881.tar.gz
pacman-2e5e496eb0936cae7ea8d2b38417feae3ba56881.tar.xz
Fix overflow warnings
Fix new warnings generated by gcc-5 about potential overflows. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c7
1 files changed, 3 insertions, 4 deletions
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);
}
}