diff options
author | Pierre Habouzit <madcoder@debian.org> | 2006-08-23 11:17:55 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-23 03:05:27 -0700 |
commit | b05faa2da9ec24d737bbba47c71e815255f3eaa7 (patch) | |
tree | 81e91df42a7649b9a273b9c92c28ae80fde29340 | |
parent | 68d42c41ef33cde500307660bb64a1c74f62711e (diff) | |
download | git-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>
-rw-r--r-- | diff-delta.c | 2 |
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; |