From 7109fb3260a2bde622a5dfab8d57f0a114ec8d32 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 23 Nov 2015 02:06:03 -0600 Subject: ensure we don't pass a negative int to ctypes functions Some implementations, e.g. cygwin, use a table lookup that can cast a char to a negative array offset. --- apps/nc/compat/readpassphrase.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/nc/compat/readpassphrase.c b/apps/nc/compat/readpassphrase.c index 0d04134..f3aa248 100644 --- a/apps/nc/compat/readpassphrase.c +++ b/apps/nc/compat/readpassphrase.c @@ -141,11 +141,11 @@ restart: if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; - if (isalpha(ch)) { + if (isalpha((unsigned char)ch)) { if ((flags & RPP_FORCELOWER)) - ch = (char)tolower(ch); + ch = (char)tolower((unsigned char)ch); if ((flags & RPP_FORCEUPPER)) - ch = (char)toupper(ch); + ch = (char)toupper((unsigned char)ch); } *p++ = ch; } -- cgit v1.2.3-55-g6feb