From: Duy Nguyen Date: Thu, 04 Jun 2015 13:10:03 GMT Subject: Re: [PATCH] index-pack: fix truncation of off_t in comparison Message-ID: In-Reply-To: <20150604123541.GA8888@peff.net> On Thu, Jun 4, 2015 at 7:35 PM, Jeff King wrote: > Commit c6458e6 (index-pack: kill union delta_base to save > memory, 2015-04-18) refactored the comparison functions used > in sorting and binary searching our delta list. The > resulting code does something like: > > int cmp_offsets(off_t a, off_t b) > { > return a - b; > } > > This works most of the time, but produces nonsensical > results when the difference between the two offsets is > larger than what can be stored in an "int". Ugh.. thanks for fixing this. Too bad neither gcc, clang or coverity spotted this. -- Duy