1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Cast ctype functions' arguments to unsigned char.

ok guenther@
This commit is contained in:
mmcc 2015-10-24 18:26:13 +00:00
parent 4f56e6a4e1
commit 5eb74ca34f
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: hack.cmd.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */
/* $OpenBSD: hack.cmd.c,v 1.8 2015/10/24 18:26:13 mmcc Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -163,7 +163,7 @@ rhack(char *cmd)
domove();
return;
}
if(movecmd(tolower(*cmd))) {
if(movecmd(tolower((unsigned char)*cmd))) {
flags.run = 1;
rush:
if(firsttime){
@ -185,7 +185,7 @@ rhack(char *cmd)
flags.run = 2;
goto rush;
}
if(*cmd == 'F' && movecmd(tolower(cmd[1]))) {
if(*cmd == 'F' && movecmd(tolower((unsigned char)cmd[1]))) {
flags.run = 3;
goto rush;
}
@ -194,7 +194,7 @@ rhack(char *cmd)
flags.nopick = 1;
goto walk;
}
if(*cmd == 'M' && movecmd(tolower(cmd[1]))) {
if(*cmd == 'M' && movecmd(tolower((unsigned char)cmd[1]))) {
flags.run = 1;
flags.nopick = 1;
goto rush;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: hack.end.c,v 1.12 2014/03/11 08:05:15 guenther Exp $ */
/* $OpenBSD: hack.end.c,v 1.13 2015/10/24 18:26:13 mmcc Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@ -685,7 +685,7 @@ prscore(int argc, char **argv)
(players[i][0] == '-' &&
players[i][1] == t1->plchar &&
players[i][2] == 0) ||
(isdigit(players[i][0]) && rank <= atoi(players[i])))
(isdigit((unsigned char)players[i][0]) && rank <= atoi(players[i])))
flg++;
}
t1 = t1->tt_next = newttentry();
@ -720,7 +720,7 @@ prscore(int argc, char **argv)
(players[i][0] == '-' &&
players[i][1] == t1->plchar &&
players[i][2] == 0) ||
(isdigit(players[i][0]) && rank <= atoi(players[i]))){
(isdigit((unsigned char)players[i][0]) && rank <= atoi(players[i]))){
outwithit:
if(outflg)
(void) outentry(rank, t1, 0);