From 037a1c83c49a6e7ff363c3004968076944ee6e68 Mon Sep 17 00:00:00 2001 From: mmcc Date: Sat, 24 Oct 2015 18:14:09 +0000 Subject: [PATCH] Cast ctype functions' arguments to unsigned char. ok guenther@ --- games/sail/pl_4.c | 4 ++-- games/sail/pl_5.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/games/sail/pl_4.c b/games/sail/pl_4.c index 12ff6069a1b..908bf3f3501 100644 --- a/games/sail/pl_4.c +++ b/games/sail/pl_4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pl_4.c,v 1.4 2009/10/27 23:59:27 deraadt Exp $ */ +/* $OpenBSD: pl_4.c,v 1.5 2015/10/24 18:14:09 mmcc Exp $ */ /* $NetBSD: pl_4.c,v 1.4 1995/04/24 12:25:17 cgd Exp $ */ /* @@ -84,7 +84,7 @@ lookout() sgetstr("What ship? ", buf, sizeof buf); foreachship(sp) { c = *countryname[sp->nationality]; - if ((c == *buf || tolower(c) == *buf || colours(sp) == *buf) + if ((c == *buf || tolower((unsigned char)c) == *buf || colours(sp) == *buf) && (sp->file->stern == buf[1] || sterncolour(sp) == buf[1] || buf[1] == '?')) { eyeball(sp); diff --git a/games/sail/pl_5.c b/games/sail/pl_5.c index 858d36c1447..2b804a50b10 100644 --- a/games/sail/pl_5.c +++ b/games/sail/pl_5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pl_5.c,v 1.6 2009/10/27 23:59:27 deraadt Exp $ */ +/* $OpenBSD: pl_5.c,v 1.7 2015/10/24 18:14:09 mmcc Exp $ */ /* $NetBSD: pl_5.c,v 1.4 1995/04/24 12:25:21 cgd Exp $ */ /* @@ -106,7 +106,7 @@ acceptmove() *p-- = '\0'; break; default: - if (!isspace(*p)) { + if (!isspace((unsigned char)*p)) { Msg("Input error."); *p-- = '\0'; } @@ -202,7 +202,7 @@ parties(crew, to, isdefense, buf) for (k = 0; k < 3; k++) temp[k] = crew[k]; - if (isdigit(buf)) { + if (isdigit((unsigned char)buf)) { ptr = isdefense ? to->file->DBP : to->file->OBP; for (j = 0; j < NBP && ptr[j].turnsent; j++) ; -- 2.20.1