diff --git a/src/hilight.c b/src/hilight.c index c551aaa0..60708811 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -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; } diff --git a/src/token.c b/src/token.c index 095b981d..838ad082 100644 --- a/src/token.c +++ b/src/token.c @@ -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; }