From: Daniel Stenberg Date: Fri, 15 Oct 2021 14:29:52 +0000 (+0200) Subject: urlapi: skip a strlen(), pass in zero X-Git-Tag: curl-7_80_0~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efffa66f655c04747e14cd734fce7fcb9626c413;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/urlapi.c b/lib/urlapi.c index 5c943c52ca..6d116b61bf 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; } diff --git a/tests/data/test1560 b/tests/data/test1560 index e8767b27bf..f6722fd419 100644 --- a/tests/data/test1560 +++ b/tests/data/test1560 @@ -2,7 +2,7 @@ unittest -URL API +URLAPI