mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:53:32 +03:00
bufref: add Curl_bufref_dup that returns a strdup()ed version
Cleans up a common pattern somewhat. Implemented as a macro. Closes #19834
This commit is contained in:
parent
d7928029fc
commit
d517efe5bd
6 changed files with 20 additions and 8 deletions
|
|
@ -45,4 +45,7 @@ size_t Curl_bufref_len(const struct bufref *br);
|
|||
CURLcode Curl_bufref_memdup0(struct bufref *br, const void *ptr, size_t len);
|
||||
void Curl_bufref_free(struct bufref *br);
|
||||
|
||||
/* return a strdup() version of the buffer */
|
||||
#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue