From: Jim Meyering Date: Sun, 27 Jul 2003 22:05:43 +0000 (+0000) Subject: (sortlines_temp): Declare local `swap' to be `int', not X-Git-Tag: v5.0.90~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=682d905a29896bb25b33cffdd62b5e5487ada4eb;p=thirdparty%2Fcoreutils.git (sortlines_temp): Declare local `swap' to be `int', not `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4) would cause lines[-1 - swap] (with swap = false) to evaluate to lines[4294967295]. --- diff --git a/src/sort.c b/src/sort.c index e9a8354c48..fd99221202 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1863,7 +1863,7 @@ sortlines_temp (struct line *lines, size_t nlines, struct line *temp) { if (nlines == 2) { - bool swap = (0 < compare (&lines[-1], &lines[-2])); + int swap = (0 < compare (&lines[-1], &lines[-2])); temp[-1] = lines[-1 - swap]; temp[-2] = lines[-2 + swap]; }