mirror of
https://github.com/curl/curl.git
synced 2024-12-15 06:40:09 +08:00
urlapi: remove an unnecessary call to strlen
- Use strcpy instead of strlen+memcpy to copy the url path. Ref: https://curl.se/mail/lib-2022-02/0006.html Closes https://github.com/curl/curl/pull/8370
This commit is contained in:
parent
9d8f3ce6d7
commit
9fe2a20b1c
@ -1005,9 +1005,7 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
|
||||
return CURLUE_NO_HOST;
|
||||
}
|
||||
|
||||
len = strlen(p);
|
||||
memcpy(path, p, len);
|
||||
path[len] = 0;
|
||||
strcpy(path, p);
|
||||
|
||||
if(schemep) {
|
||||
u->scheme = strdup(schemep);
|
||||
|
Loading…
Reference in New Issue
Block a user