unsigned char cast in hash functions
This commit is contained in:
parent
e45e3caa84
commit
6458fdc5bd
|
|
@ -30,13 +30,13 @@ static unsigned int hi_hash(const char *tok)
|
|||
|
||||
if(xctx->sch_path_hash[xctx->currsch] == 0) {
|
||||
str=xctx->sch_path[xctx->currsch];
|
||||
while ( (c = *str++) )
|
||||
while ( (c = (unsigned char)*str++) )
|
||||
hash += (hash << 5) + c;
|
||||
xctx->sch_path_hash[xctx->currsch] = hash;
|
||||
} else {
|
||||
hash = xctx->sch_path_hash[xctx->currsch];
|
||||
}
|
||||
while ( (c = *tok++) )
|
||||
while ( (c = (unsigned char)*tok++) )
|
||||
hash += (hash << 5) + c;
|
||||
return hash;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ unsigned int str_hash(const char *tok)
|
|||
register unsigned int hash = 5381;
|
||||
register unsigned int c;
|
||||
|
||||
while ( (c = *tok++) )
|
||||
while ( (c = (unsigned char)*tok++) )
|
||||
hash += (hash << 5) + c;
|
||||
return hash;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue