summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorrilysh <nightquick@proton.me>2024-01-21 12:18:09 +0530
committerTomas Mraz <tomas@openssl.org>2024-01-25 16:39:09 +0100
commit0f644b96d209443b4566f7e86e3be2568292e75b (patch)
tree6f09a8f3a719e42ae35af6abe3092e18f3aca591 /crypto
parentea6268cfceaba24328d66bd14bfc97c4fac14a58 (diff)
replace strstr() with strchr() for single characters
strstr() is used to match multiple characters in the haystack, whereas strchr() is used to matched only single character. CLA: trivial Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23347)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dso/dso_dl.c2
-rw-r--r--crypto/dso/dso_dlfcn.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/dso/dso_dl.c b/crypto/dso/dso_dl.c
index ac94254807..a2ec5c77f3 100644
--- a/crypto/dso/dso_dl.c
+++ b/crypto/dso/dso_dl.c
@@ -217,7 +217,7 @@ static char *dl_name_converter(DSO *dso, const char *filename)
len = strlen(filename);
rsize = len + 1;
- transform = (strstr(filename, "/") == NULL);
+ transform = (strchr(filename, '/') == NULL);
if (transform) {
/* We will convert this to "%s.s?" or "lib%s.s?" */
rsize += strlen(DSO_EXTENSION); /* The length of ".s?" */
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index 2befd67248..e128b4cc03 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -251,7 +251,7 @@ static char *dlfcn_name_converter(DSO *dso, const char *filename)
len = strlen(filename);
rsize = len + 1;
- transform = (strstr(filename, "/") == NULL);
+ transform = (strchr(filename, '/') == NULL);
if (transform) {
/* We will convert this to "%s.so" or "lib%s.so" etc */
rsize += strlen(DSO_EXTENSION); /* The length of ".so" */