diff options
Diffstat (limited to 'bin/sh/exec.c')
-rw-r--r-- | bin/sh/exec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c index e547e31..d245b55 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -524,17 +524,16 @@ static struct tblentry **lastcmdentry; static struct tblentry * cmdlookup(const char *name, int add) { - int hashval; + unsigned int hashval; const char *p; struct tblentry *cmdp; struct tblentry **pp; size_t len; p = name; - hashval = *p << 4; + hashval = (unsigned char)*p << 4; while (*p) hashval += *p++; - hashval &= 0x7FFF; pp = &cmdtable[hashval % CMDTABLESIZE]; for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) { if (equal(cmdp->cmdname, name)) |