From fba140c73541c03e22b4fdb219a05d129bf0406d Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Tue, 12 Apr 2022 12:30:08 +0200 Subject: str[n]casecmp => OPENSSL_strncasecmp Reviewed-by: Tim Hudson Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18069) --- crypto/conf/conf_def.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'crypto/conf/conf_def.c') diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 9d79a900c8..ef45e7d38e 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -11,7 +11,7 @@ #include #include -#include "internal/e_os.h" /* strcasecmp and struct stat */ +#include "internal/e_os.h" /* struct stat */ #ifdef __TANDEM # include /* needed for stat.h */ # include /* struct stat */ @@ -192,11 +192,11 @@ static int def_load(CONF *conf, const char *name, long *line) /* Parse a boolean value and fill in *flag. Return 0 on error. */ static int parsebool(const char *pval, int *flag) { - if (strcasecmp(pval, "on") == 0 - || strcasecmp(pval, "true") == 0) { + if (OPENSSL_strcasecmp(pval, "on") == 0 + || OPENSSL_strcasecmp(pval, "true") == 0) { *flag = 1; - } else if (strcasecmp(pval, "off") == 0 - || strcasecmp(pval, "false") == 0) { + } else if (OPENSSL_strcasecmp(pval, "off") == 0 + || OPENSSL_strcasecmp(pval, "false") == 0) { *flag = 0; } else { ERR_raise(ERR_LIB_CONF, CONF_R_INVALID_PRAGMA); @@ -839,8 +839,10 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx) namelen = strlen(filename); - if ((namelen > 5 && strcasecmp(filename + namelen - 5, ".conf") == 0) - || (namelen > 4 && strcasecmp(filename + namelen - 4, ".cnf") == 0)) { + if ((namelen > 5 + && OPENSSL_strcasecmp(filename + namelen - 5, ".conf") == 0) + || (namelen > 4 + && OPENSSL_strcasecmp(filename + namelen - 4, ".cnf") == 0)) { size_t newlen; char *newpath; BIO *bio; -- cgit v1.2.3