summaryrefslogtreecommitdiffstats
path: root/bin/sh/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/exec.c')
-rw-r--r--bin/sh/exec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c
index c9d4126..7d18c3c 100644
--- a/bin/sh/exec.c
+++ b/bin/sh/exec.c
@@ -522,17 +522,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))
OpenPOWER on IntegriCloud