sha1_name: make wraparound of the index into ring-buffer explicit
commit3e98919a188e36f34c1a20e23ecf2ff1f5da75c9
authorRené Scharfe <l.s.r@web.de>
Tue, 1 Nov 2016 08:49:07 +0000 (1 09:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Nov 2016 17:56:39 +0000 (1 10:56 -0700)
tree05b5ca11379495d3dd7dbd92ce2a725895da6c57
parent4f03666ac69ec4799998f010d04916c12e38edf8
sha1_name: make wraparound of the index into ring-buffer explicit

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: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c