Make sure to use unsigned char for is*() functions

On some platforms, the implementation is such that a signed char
triggers a warning when used with is*() functions.  On others, the
behavior is outright buggy when presented with a char that happens
to get promoted to a negative integer.

The safest thing is to cast the char that's used to an unsigned char.

Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
Richard Levitte
2016-02-14 13:02:15 +01:00
parent ef8ca6bd54
commit 18295f0c2d
7 changed files with 25 additions and 16 deletions

View File

@@ -1380,7 +1380,7 @@ int s_server_main(int argc, char *argv[])
case OPT_PSK:
#ifndef OPENSSL_NO_PSK
for (p = psk_key = opt_arg(); *p; p++) {
if (isxdigit(*p))
if (isxdigit(_UC(*p)))
continue;
BIO_printf(bio_err, "Not a hex number '%s'\n", *argv);
goto end;