Re: [PATCH] sha1_name: make wraparound of the index into ring-buffer explicit

2016-11-01 Thread Jeff King
On Tue, Nov 01, 2016 at 09:49:07AM +0100, René Scharfe wrote: > Overflow is defined for unsigned integers, but not for signed ones. > Wrap around explicitly for the new ring-buffer in find_unique_abbrev() > as we did in bb84735c for the ones in sha1_to_hex() and get_pathname(), > thus avoiding sig

[PATCH] sha1_name: make wraparound of the index into ring-buffer explicit

2016-11-01 Thread René Scharfe
Overflow is defined for unsigned integers, but not for signed ones. Wrap around explicitly for the new ring-buffer in find_unique_abbrev() as we did in bb84735c for the ones in sha1_to_hex() and get_pathname(), thus avoiding signed overflows and getting rid of the magic number 3. Signed-off-by: Re