summaryrefslogtreecommitdiff
path: root/src/sha1_lookup.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-08-14 10:31:02 +0200
committerVicent Marti <tanoku@gmail.com>2013-08-14 10:31:02 +0200
commite2164da5eb2d76129b8dae0b5ea2f7a606324fba (patch)
tree6edb65787cbeb1b1046b41a8abe577301842ed63 /src/sha1_lookup.c
parent67591c8cd8d55e6f3218f1a734385c845459e1ff (diff)
downloadlibgit2-e2164da5eb2d76129b8dae0b5ea2f7a606324fba.tar.gz
sha1_lookup: Hello my name is MSVC and how do I pointer
Diffstat (limited to 'src/sha1_lookup.c')
-rw-r--r--src/sha1_lookup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sha1_lookup.c b/src/sha1_lookup.c
index 8aca86335..35149a18d 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;