summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 81ad10609..2cf7b158b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -391,10 +391,11 @@ int git__bsearch(
int (*compare)(const void *, const void *),
size_t *position)
{
- int lim, cmp = -1;
+ unsigned int lim;
+ int cmp = -1;
void **part, **base = array;
- for (lim = array_len; lim != 0; lim >>= 1) {
+ for (lim = (unsigned int)array_len; lim != 0; lim >>= 1) {
part = base + (lim >> 1);
cmp = (*compare)(key, *part);
if (cmp == 0) {