From: HenrikHolst Date: Tue, 1 Feb 2022 12:50:21 +0000 (+0100) Subject: urlapi: remove an unnecessary call to strlen X-Git-Tag: curl-7_82_0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fe2a20b1cfe6aa25d211b5a9069e68dd017f3cc;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/urlapi.c b/lib/urlapi.c index d29aeb238f..66d6bf487f 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);