Merge branch 'tz/fsf-address-update' of ../git-gui into tz/fsf-address-update
[gitweb.git] / xdiff / xpatience.c
index a613efc7034bc0dc45bf13428c819701f044323d..a44e776328ce617c3144c17870ab1616a2239947 100644 (file)
@@ -13,8 +13,8 @@
  *  Lesser General Public License for more details.
  *
  *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  License along with this library; if not, see
+ *  <http://www.gnu.org/licenses/>.
  *
  *  Davide Libenzi <davidel@xmailserver.org>
  *
@@ -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;