Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Tests: clean up and document submodule helpers
[gitweb.git]
/
string-list.c
diff --git
a/string-list.c
b/string-list.c
index 806b4c87232fb2ed307f6ce64817e14feefc216f..a0cf0cfe88ee38f35ec33662778ec1bd7036a127 100644
(file)
--- a/
string-list.c
+++ b/
string-list.c
@@
-16,7
+16,7
@@
static int get_entry_index(const struct string_list *list, const char *string,
compare_strings_fn cmp = list->cmp ? list->cmp : strcmp;
while (left + 1 < right) {
- int middle =
(left + righ
t) / 2;
+ int middle =
left + (right - lef
t) / 2;
int compare = cmp(string, list->items[middle].string);
if (compare < 0)
right = middle;