submodule.c: report the submodule that an error occurs in
[gitweb.git] / builtin / unpack-objects.c
index 689a29fac1a50df6e5b8fc3cda617ef1c6d060b3..62ea264c46783374d0f1968c19ea7581498a1f87 100644 (file)
@@ -394,7 +394,7 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
                lo = 0;
                hi = nr;
                while (lo < hi) {
-                       mid = (lo + hi)/2;
+                       mid = lo + (hi - lo) / 2;
                        if (base_offset < obj_list[mid].offset) {
                                hi = mid;
                        } else if (base_offset > obj_list[mid].offset) {