diff options
author | Brent Cook <busterb@gmail.com> | 2015-11-23 02:06:03 -0600 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2015-11-23 02:06:03 -0600 |
commit | 7109fb3260a2bde622a5dfab8d57f0a114ec8d32 (patch) | |
tree | ab747bc7767e2f1efd167510450ba3f1686a57fb /apps/nc | |
parent | 9574b6c8ec0096480a2954774b95c4165df51799 (diff) | |
download | portable-7109fb3260a2bde622a5dfab8d57f0a114ec8d32.tar.gz portable-7109fb3260a2bde622a5dfab8d57f0a114ec8d32.tar.bz2 portable-7109fb3260a2bde622a5dfab8d57f0a114ec8d32.zip |
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.
Diffstat (limited to 'apps/nc')
-rw-r--r-- | apps/nc/compat/readpassphrase.c | 6 |
1 files changed, 3 insertions, 3 deletions
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: | |||
141 | if (p < end) { | 141 | if (p < end) { |
142 | if ((flags & RPP_SEVENBIT)) | 142 | if ((flags & RPP_SEVENBIT)) |
143 | ch &= 0x7f; | 143 | ch &= 0x7f; |
144 | if (isalpha(ch)) { | 144 | if (isalpha((unsigned char)ch)) { |
145 | if ((flags & RPP_FORCELOWER)) | 145 | if ((flags & RPP_FORCELOWER)) |
146 | ch = (char)tolower(ch); | 146 | ch = (char)tolower((unsigned char)ch); |
147 | if ((flags & RPP_FORCEUPPER)) | 147 | if ((flags & RPP_FORCEUPPER)) |
148 | ch = (char)toupper(ch); | 148 | ch = (char)toupper((unsigned char)ch); |
149 | } | 149 | } |
150 | *p++ = ch; | 150 | *p++ = ch; |
151 | } | 151 | } |