summaryrefslogtreecommitdiffstats
path: root/crypto/conf
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-06-21 08:55:50 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-11-17 15:48:34 +0100
commit2ff286c26c29b69b02ca99656d26d2f8cfd54682 (patch)
tree71a01c51c47d0dd9528ff14357615d71420ba5a1 /crypto/conf
parenta6838c8d52087f2b0494bbab8486e10944aff7f7 (diff)
Add and use HAS_PREFIX() and CHECK_AND_SKIP_PREFIX() for checking if string has literal prefix
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15847)
Diffstat (limited to 'crypto/conf')
-rw-r--r--crypto/conf/conf_def.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index c05c3c6b10..26764dad00 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -389,8 +389,8 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
psection = section;
}
p = eat_ws(conf, end);
- if (strncmp(pname, ".pragma", 7) == 0
- && (p != pname + 7 || *p == '=')) {
+ if (CHECK_AND_SKIP_PREFIX(pname, ".pragma")
+ && (p != pname || *p == '=')) {
char *pval;
if (*p == '=') {
@@ -435,8 +435,8 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
* We *ignore* any unknown pragma.
*/
continue;
- } else if (strncmp(pname, ".include", 8) == 0
- && (p != pname + 8 || *p == '=')) {
+ } else if (CHECK_AND_SKIP_PREFIX(pname, ".include")
+ && (p != pname || *p == '=')) {
char *include = NULL;
BIO *next;
const char *include_dir = ossl_safe_getenv("OPENSSL_CONF_INCLUDE");