bdiff.c: cast to unsigned char when computing hash value
authorMarkus F.X.J. Oberhumer <markus@oberhumer.com>
Wed, 23 Mar 2011 02:33:22 +0100
changeset 13730 df978f28a259
parent 13729 4a9c09239ba1
child 13731 5d0cdf4ec338
bdiff.c: cast to unsigned char when computing hash value
mercurial/bdiff.c
--- a/mercurial/bdiff.c	Wed Mar 23 02:33:21 2011 +0100
+++ b/mercurial/bdiff.c	Wed Mar 23 02:33:22 2011 +0100
@@ -84,7 +84,7 @@
 	h = 0;
 	for (p = a; p < a + len; p++) {
 		/* Leonid Yuriev's hash */
-		h = (h * 1664525) + *p + 1013904223;
+		h = (h * 1664525) + (unsigned char)*p + 1013904223;
 
 		if (*p == '\n' || p == plast) {
 			l->h = h;