diff options
author | Matt Caswell <matt@openssl.org> | 2023-04-21 10:17:11 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-04-24 11:12:48 +0100 |
commit | a80840c663e3409203b0235764e53d8624f74cb8 (patch) | |
tree | 8d2b06b44559443225af76a7045d7972750f80c9 /apps | |
parent | 6799fc2409823939cde5b4a0da909e16ef78d3a8 (diff) | |
download | openssl-new-a80840c663e3409203b0235764e53d8624f74cb8.tar.gz |
Replace use of strstr with strchr
It is better to use strchr where we are looking for a single character.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20788)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/s_client.c b/apps/s_client.c index c69b8e4058..d6fd124da8 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -3828,7 +3828,7 @@ static int user_data_process(struct user_data_st *user_data, size_t *len, cmd_start[outlen] = '\0'; for (;;) { - cmd_start = strstr(cmd_start, "{"); + cmd_start = strchr(cmd_start, '{'); if (cmd_start == buf_start && *(cmd_start + 1) == '{') { /* The "{" is escaped, so skip it */ cmd_start += 2; @@ -3843,7 +3843,7 @@ static int user_data_process(struct user_data_st *user_data, size_t *len, if (cmd_start == buf_start) { /* Command detected */ - char *cmd_end = strstr(cmd_start, "}"); + char *cmd_end = strchr(cmd_start, '}'); char *arg_start; int cmd = -1, ret = USER_DATA_PROCESS_NO_DATA; size_t oldoff; @@ -3858,7 +3858,7 @@ static int user_data_process(struct user_data_st *user_data, size_t *len, return USER_DATA_PROCESS_NO_DATA; } *cmd_end = '\0'; - arg_start = strstr(cmd_start, ":"); + arg_start = strchr(cmd_start, ':'); if (arg_start != NULL) { *arg_start = '\0'; arg_start++; |