Cast ctype functions' arguments to unsigned char.
authormmcc <mmcc@openbsd.org>
Sat, 24 Oct 2015 18:26:13 +0000 (18:26 +0000)
committermmcc <mmcc@openbsd.org>
Sat, 24 Oct 2015 18:26:13 +0000 (18:26 +0000)
ok guenther@

games/hack/hack.cmd.c
games/hack/hack.end.c

index 4d9fee3..106136c 100644 (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;
index 680285a..32b60a6 100644 (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);