From 5eb74ca34fab44451bcf53f89d41518b30e28499 Mon Sep 17 00:00:00 2001 From: mmcc Date: Sat, 24 Oct 2015 18:26:13 +0000 Subject: [PATCH] Cast ctype functions' arguments to unsigned char. ok guenther@ --- games/hack/hack.cmd.c | 8 ++++---- games/hack/hack.end.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/games/hack/hack.cmd.c b/games/hack/hack.cmd.c index 4d9fee363e1..106136cf67e 100644 --- a/games/hack/hack.cmd.c +++ b/games/hack/hack.cmd.c @@ -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; diff --git a/games/hack/hack.end.c b/games/hack/hack.end.c index 680285a178e..32b60a67fe3 100644 --- a/games/hack/hack.end.c +++ b/games/hack/hack.end.c @@ -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); -- 2.20.1