mirror of
https://github.com/curl/curl.git
synced 2026-08-26 19: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
|
|
@ -16,5 +16,4 @@ allowfunc send
|
|||
allowfunc snprintf
|
||||
allowfunc socket
|
||||
allowfunc sscanf
|
||||
allowfunc strdup
|
||||
allowfunc vsnprintf
|
||||
|
|
|
|||
|
|
@ -69,10 +69,6 @@ extern const struct entry_s s_entries[];
|
|||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# define strdup _strdup
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n)
|
||||
#elif defined(HAVE_STRCASECMP)
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ static int validate_access(struct testcase *test,
|
|||
(long)our_getpid());
|
||||
|
||||
logmsg("Are-we-friendly question received");
|
||||
test->buffer = strdup(weare);
|
||||
test->buffer = curlx_strdup(weare);
|
||||
test->rptr = test->buffer; /* set read pointer */
|
||||
test->bufsize = count; /* set total count */
|
||||
test->rcount = count; /* set data left to read */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue