mirror of
https://github.com/curl/curl.git
synced 2026-08-26 22:34:45 +03:00
lib: rename Curl_strndup to Curl_memdup0 to avoid misunderstanding
Since the copy does not stop at a null byte, let's not call it anything that makes you think it works like the common strndup() function. Based on feedback from Jay Satiro, Stefan Eissing and Patrick Monnerat Closes #12490
This commit is contained in:
parent
6d8dc2f636
commit
7c992dd9f8
15 changed files with 27 additions and 27 deletions
|
|
@ -123,11 +123,11 @@ static struct altsvc *altsvc_createid(const char *srchost,
|
|||
dlen -= 2;
|
||||
}
|
||||
|
||||
as->src.host = Curl_strndup(srchost, hlen);
|
||||
as->src.host = Curl_memdup0(srchost, hlen);
|
||||
if(!as->src.host)
|
||||
goto error;
|
||||
|
||||
as->dst.host = Curl_strndup(dsthost, dlen);
|
||||
as->dst.host = Curl_memdup0(dsthost, dlen);
|
||||
if(!as->dst.host)
|
||||
goto error;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue