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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user