1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 23:38:49 -05:00

pacsort: fix warning about signed overflow potential during comparison.

Some crazy person assumed we would have fewer than INT_MAX columns.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2015-04-23 16:45:51 +10:00 committed by Allan McRae
parent 54067c390f
commit d4e5de4bf6

View File

@ -308,7 +308,7 @@ static const char *nth_column(const char *string)
int col;
ptr = prev = string;
for(col = 1; ptr && col <= opts.sortkey; col++) {
for(col = 0; ptr && col < opts.sortkey; col++) {
prev = ptr;
ptr = strchr(ptr, opts.delim);
if(ptr) {