summaryrefslogtreecommitdiff
path: root/diff-delta.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2006-08-23 11:17:55 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-23 03:05:27 -0700
commitb05faa2da9ec24d737bbba47c71e815255f3eaa7 (patch)
tree81e91df42a7649b9a273b9c92c28ae80fde29340 /diff-delta.c
parent68d42c41ef33cde500307660bb64a1c74f62711e (diff)
downloadgit-b05faa2da9ec24d737bbba47c71e815255f3eaa7.tar.gz
Fix a comparison bug in diff-delta.c
(1 << i) < hspace is compared in the `int` space rather that in the unsigned one. the result will be wrong if hspace is between 0x40000000 and 0x80000000. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff-delta.c')
-rw-r--r--diff-delta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff-delta.c b/diff-delta.c
index 7da9205a5d..51e2e56177 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -152,7 +152,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
initialization in create_delta(). */
entries = (bufsize - 1) / RABIN_WINDOW;
hsize = entries / 4;
- for (i = 4; (1 << i) < hsize && i < 31; i++);
+ for (i = 4; (1u << i) < hsize && i < 31; i++);
hsize = 1 << i;
hmask = hsize - 1;