diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-10-15 16:29:52 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-10-15 23:22:14 +0200 |
commit | efffa66f655c04747e14cd734fce7fcb9626c413 (patch) | |
tree | b2df5fd039e24cc73de4a4fca7494bea5194f897 /lib | |
parent | ccb466fd36b7a931b005a6d8124c4fbc322a16c7 (diff) | |
download | curl-efffa66f655c04747e14cd734fce7fcb9626c413.tar.gz |
urlapi: skip a strlen(), pass in zero
... to let curl_easy_escape() itself do the strlen. This avoids a (false
positive) Coverity warning and it avoids us having to store the strlen()
return value in an int variable.
Reviewed-by: Daniel Gustafsson
Closes #7862
Diffstat (limited to 'lib')
-rw-r--r-- | lib/urlapi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c index 5c943c52c..6d116b61b 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -1295,8 +1295,7 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what, } } else if(urlencode) { - int hostlen = (int)strlen(u->host); - allochost = curl_easy_escape(NULL, u->host, hostlen); + allochost = curl_easy_escape(NULL, u->host, 0); if(!allochost) return CURLUE_OUT_OF_MEMORY; } |