# HG changeset patch # User Markus F.X.J. Oberhumer # Date 2011-03-23 01:33:22 # Node ID df978f28a259385fff9af115e961784e406c5707 # Parent 4a9c09239ba13a17bc2ee0d1cb504b9850b74dc4 bdiff.c: cast to unsigned char when computing hash value diff --git a/mercurial/bdiff.c b/mercurial/bdiff.c --- a/mercurial/bdiff.c +++ b/mercurial/bdiff.c @@ -84,7 +84,7 @@ static int splitlines(const char *a, int 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;