summaryrefslogtreecommitdiff
path: root/src/hashtable.c
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-03-14 17:36:15 -0700
committerRussell Belfer <arrbee@arrbee.com>2012-03-14 17:36:15 -0700
commitdeafee7bd7a9e2efcdff90627b6094d8c1519319 (patch)
tree4b11910d7d315a6db667cc4af4c6749630612ed3 /src/hashtable.c
parentab43ad2fd822504446e7876d6352c968a74beb53 (diff)
downloadlibgit2-deafee7bd7a9e2efcdff90627b6094d8c1519319.tar.gz
Continue error conversion
This converts blob.c, fileops.c, and all of the win32 files. Also, various minor cleanups throughout the code. Plus, in testing the win32 build, I cleaned up a bunch (although not all) of the warnings with the 64-bit build.
Diffstat (limited to 'src/hashtable.c')
-rw-r--r--src/hashtable.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hashtable.c b/src/hashtable.c
index 0364bb52b..8e057d4b1 100644
--- a/src/hashtable.c
+++ b/src/hashtable.c
@@ -258,5 +258,10 @@ uint32_t git_hash__strhash_cb(const void *key, int hash_id)
0x7daaab3c
};
- return git__hash(key, strlen((const char *)key), hash_seeds[hash_id]);
+ size_t key_len = strlen((const char *)key);
+
+ /* won't take hash of strings longer than 2^31 right now */
+ assert(key_len == (size_t)((int)key_len));
+
+ return git__hash(key, (int)key_len, hash_seeds[hash_id]);
}