misc: reduce strlen() calls with Curl_dyn_add()

Use STRCONST() to switch from Curl_dyn_add() to Curl_dyn_addn() for
string literals.

Closes #8398
This commit is contained in:
HenrikHolst 2022-02-07 19:25:09 +01:00 committed by Daniel Stenberg
parent 2a1951519e
commit b807219292
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 37 additions and 34 deletions

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -142,7 +142,7 @@ static int hyper_each_header(void *userdata,
return HYPER_ITER_BREAK;
}
else {
if(Curl_dyn_add(&data->state.headerb, "\r\n"))
if(Curl_dyn_addn(&data->state.headerb, STRCONST("\r\n")))
return HYPER_ITER_BREAK;
}
len = Curl_dyn_len(&data->state.headerb);