Commit e2164da5eb2d76129b8dae0b5ea2f7a606324fba

Vicent Marti 2013-08-14T10:31:02

sha1_lookup: Hello my name is MSVC and how do I pointer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/sha1_lookup.c b/src/sha1_lookup.c
index 8aca863..35149a1 100644
--- a/src/sha1_lookup.c
+++ b/src/sha1_lookup.c
@@ -183,9 +183,11 @@ int sha1_position(const void *table,
 			unsigned lo, unsigned hi,
 			const unsigned char *key)
 {
+	const unsigned char *base = table;
+
 	do {
 		unsigned mi = (lo + hi) / 2;
-		int cmp = git_oid__cmp(table + mi * stride, (git_oid *)key);
+		int cmp = git_oid__cmp((git_oid *)(base + mi * stride), (git_oid *)key);
 
 		if (!cmp)
 			return mi;