diff options
author | HenrikHolst <henrik.holst@millistream.com> | 2022-02-01 13:50:21 +0100 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2022-02-01 15:43:45 -0500 |
commit | 9fe2a20b1cfe6aa25d211b5a9069e68dd017f3cc (patch) | |
tree | 7e630a984c69519c47ff9da5917c14b6ea41ae8c /lib/urlapi.c | |
parent | 9d8f3ce6d7e3c192f8387d27703bbf6a31f3ec53 (diff) | |
download | curl-9fe2a20b1cfe6aa25d211b5a9069e68dd017f3cc.tar.gz |
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
Diffstat (limited to 'lib/urlapi.c')
-rw-r--r-- | lib/urlapi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c index d29aeb238..66d6bf487 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -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); |