mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
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
This commit is contained in:
parent
ccb466fd36
commit
efffa66f65
@ -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;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<info>
|
||||
<keywords>
|
||||
unittest
|
||||
URL API
|
||||
URLAPI
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user