From 9c23307a93cc58e4645c18f7d1717f4ab94dedc3 Mon Sep 17 00:00:00 2001 From: mmcc Date: Sat, 24 Oct 2015 18:39:05 +0000 Subject: [PATCH] Cast ctype functions' argument to unsigned char. ok guenther@ --- games/monop/getinp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/games/monop/getinp.c b/games/monop/getinp.c index ad93241656a..6eb8c8fa324 100644 --- a/games/monop/getinp.c +++ b/games/monop/getinp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getinp.c,v 1.9 2009/10/27 23:59:26 deraadt Exp $ */ +/* $OpenBSD: getinp.c,v 1.10 2015/10/24 18:39:05 mmcc Exp $ */ /* $NetBSD: getinp.c,v 1.4 1995/04/24 12:24:20 cgd Exp $ */ /* @@ -79,8 +79,8 @@ getinp(prompt, list) if ((sp = strchr(buf, '\n')) != NULL) *sp = '\0'; for (sp = buf; *sp; sp++) - if (isupper(*sp)) - *sp = tolower(*sp); + if (isupper((unsigned char)*sp)) + *sp = tolower((unsigned char)*sp); for (i = n_match = 0; list[i]; i++) if (comp(list[i])) { n_match++; @@ -102,7 +102,8 @@ comp(s1) if (buf[0] != '\0') for (sp = buf, tsp = s1; *sp; ) { - c = isupper(*tsp) ? tolower(*tsp) : *tsp; + c = isupper((unsigned char)*tsp) ? + tolower((unsigned char)*tsp) : *tsp; tsp++; if (c != *sp++) return 0; -- 2.20.1