From fefeecf00dd75a44dc33569f857aa741f59ccbb4 Mon Sep 17 00:00:00 2001 From: Michael Baentsch <57787676+baentsch@users.noreply.github.com> Date: Thu, 8 Jun 2023 08:05:42 +0200 Subject: Cast the argument to unsigned char when calling isspace() Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/21151) (cherry picked from commit 8a2e74d0536c91585fbe789e0ab7b06cab0289c2) --- test/evp_test.c | 4 ++-- test/testutil/provider.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/evp_test.c b/test/evp_test.c index 19cabd6dce..efc6709673 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -3683,11 +3683,11 @@ static int prov_available(char *providers) int more = 1; while (more) { - for (; isspace(*providers); providers++) + for (; isspace((unsigned char)(*providers)); providers++) continue; if (*providers == '\0') break; /* End of the road */ - for (p = providers; *p != '\0' && !isspace(*p); p++) + for (p = providers; *p != '\0' && !isspace((unsigned char)(*p)); p++) continue; if (*p == '\0') more = 0; diff --git a/test/testutil/provider.c b/test/testutil/provider.c index 3f94d7506e..79ae13b42a 100644 --- a/test/testutil/provider.c +++ b/test/testutil/provider.c @@ -177,11 +177,11 @@ int fips_provider_version_match(OSSL_LIB_CTX *libctx, const char *versions) } mode; while (*versions != '\0') { - for (; isspace(*versions); versions++) + for (; isspace((unsigned char)(*versions)); versions++) continue; if (*versions == '\0') break; - for (p = versions; *versions != '\0' && !isspace(*versions); versions++) + for (p = versions; *versions != '\0' && !isspace((unsigned char)(*versions)); versions++) continue; if (*p == '!') { mode = MODE_NE; -- cgit v1.2.3