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

games/hack/makedefs.c

index 44d117e..af1c25a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: makedefs.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $    */
+/*     $OpenBSD: makedefs.c,v 1.8 2015/10/24 17:43:28 mmcc Exp $       */
 
 /*
  * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -203,12 +203,12 @@ getentry()
        while(1) {
                ch = nextchar();
        swi:
-               if(isalpha(ch)){
+               if(isalpha((unsigned char)ch)){
                        ip = identif;
                        do {
                                if(ip < identif+NSZ-1) *ip++ = ch;
                                ch = nextchar();
-                       } while(isalpha(ch) || isdigit(ch));
+                       } while(isalpha((unsigned char)ch) || isdigit((unsigned char)ch));
                        *ip = 0;
                        while(ch == ' ' || ch == '\t') ch = nextchar();
                        if(ch == '(' && !inparens && !stringseen)
@@ -294,5 +294,5 @@ getentry()
 void
 capitalize(char *sp)
 {
-       *sp = (char)toupper(*sp);
+       *sp = (char)toupper((unsigned char)*sp);
 }