mirror of
https://github.com/curl/curl.git
synced 2026-08-25 05:23:32 +03:00
build: tidy up and dedupe strdup functions
- de-dupe lib/src strdup/memdup functions into curlx. - introduce `CURLX_STRDUP_LOW()` for mapping `strdup()`, and to do it at one place within the code, in `curl_setup.h`. - tests/server: use `curlx_strdup()`. (Also to fix building without a system `strdup()`.) - curlx/curlx.h: shorten and tidy up. - adjust Windows build path to not need `HAVE_STRDUP`. - build: stop detecting `HAVE_STRDUP` on Windows. Closes #20497
This commit is contained in:
parent
e39650c984
commit
31a4f415af
50 changed files with 171 additions and 333 deletions
|
|
@ -31,7 +31,7 @@ struct Curl_easy;
|
|||
|
||||
#include "urldata.h" /* for struct Curl_easy */
|
||||
#include "mime.h"
|
||||
#include "strdup.h"
|
||||
#include "curlx/strdup.h"
|
||||
#include "bufref.h"
|
||||
#include "curlx/fopen.h"
|
||||
|
||||
|
|
@ -696,7 +696,7 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len)
|
|||
|
||||
if(!name || !len)
|
||||
return curl_mime_name(part, name);
|
||||
zname = Curl_memdup0(name, len);
|
||||
zname = curlx_memdup0(name, len);
|
||||
if(!zname)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
res = curl_mime_name(part, zname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue