Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
cleanup: fix possible overflow errors in binary search
[gitweb.git]
/
sha1_name.c
diff --git
a/sha1_name.c
b/sha1_name.c
index 134ac9742f9eed3dc6e587875bdb9aa77b7a8307..c7c5ab376ccb56b3a4f4533f61293bd543ea8097 100644
(file)
--- a/
sha1_name.c
+++ b/
sha1_name.c
@@
-157,7
+157,7
@@
static void unique_in_pack(struct packed_git *p,
num = p->num_objects;
last = num;
while (first < last) {
- uint32_t mid =
(first + la
st) / 2;
+ uint32_t mid =
first + (last - fir
st) / 2;
const unsigned char *current;
int cmp;