mirror of
https://github.com/curl/curl.git
synced 2026-08-13 13:10:54 +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
|
|
@ -4170,7 +4170,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data)
|
|||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
ftpc->dirs[0] = Curl_strndup(rawPath, dirlen);
|
||||
ftpc->dirs[0] = Curl_memdup0(rawPath, dirlen);
|
||||
if(!ftpc->dirs[0]) {
|
||||
free(rawPath);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
|
@ -4214,7 +4214,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data)
|
|||
CWD requires a parameter and a non-existent parameter a) doesn't
|
||||
work on many servers and b) has no effect on the others. */
|
||||
if(compLen > 0) {
|
||||
char *comp = Curl_strndup(curPos, compLen);
|
||||
char *comp = Curl_memdup0(curPos, compLen);
|
||||
if(!comp) {
|
||||
free(rawPath);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue