OSDN Git Service

diff: introduce DIFF_PICKAXE_KINDS_MASK
[git-core/git.git] / string-list.c
index 806b4c8..a0cf0cf 100644 (file)
@@ -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 + right) / 2;
+               int middle = left + (right - left) / 2;
                int compare = cmp(string, list->items[middle].string);
                if (compare < 0)
                        right = middle;