Merge branch 'wk/merge-options-gpg-sign-doc'
[gitweb.git] / xdiff / xpatience.c
index a613efc7034bc0dc45bf13428c819701f044323d..9f91702de740c3a2ca922059e71a32b0245edf1b 100644 (file)
@@ -166,7 +166,7 @@ static int binary_search(struct entry **sequence, int longest,
        int left = -1, right = longest;
 
        while (left + 1 < right) {
-               int middle = (left + right) / 2;
+               int middle = left + (right - left) / 2;
                /* by construction, no two entries can be equal */
                if (sequence[middle]->line2 > entry->line2)
                        right = middle;