diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 699ac0240..0b34f7106 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -613,7 +613,7 @@ hb_bsearch (const void *key, const void *base, int min = 0, max = (int) nmemb - 1; while (min <= max) { - int mid = (min + max) / 2; + int mid = ((unsigned int) min + (unsigned int) max) / 2; const void *p = (const void *) (((const char *) base) + (mid * size)); int c = compar (key, p, ds...); if (c < 0)