From: Pierre Habouzit Date: Wed, 23 Aug 2006 09:17:55 +0000 (+0200) Subject: Fix a comparison bug in diff-delta.c X-Git-Tag: v1.4.3-rc1~210 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b05faa2da9ec24d737bbba47c71e815255f3eaa7;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/diff-delta.c b/diff-delta.c index 7da9205a5..51e2e5617 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;