Merge pull request #6 from pmatos/patch-4

Make variables unsigned to avoid ub in calculation
original commit: 2c404b7232555b405027819fd1841cefe5322180
This commit is contained in:
Matthew Flatt 2019-06-06 08:56:48 -06:00 committed by GitHub
commit a0fea7f0a8

View File

@ -85,7 +85,7 @@ static ptr bvstring(const char *s) {
/* multiplier weights each character, h = n factors in the length */ /* multiplier weights each character, h = n factors in the length */
static iptr symhash(s) const char *s; { static iptr symhash(s) const char *s; {
iptr n, h; uptr n, h;
h = n = strlen(s); h = n = strlen(s);
while (n--) h = h * multiplier + *s++; while (n--) h = h * multiplier + *s++;