mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:43:34 +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
|
|
@ -93,3 +93,12 @@ size_t Curl_bufref_len(const struct bufref *br);
|
|||
```
|
||||
|
||||
Returns the stored length of the referenced buffer.
|
||||
|
||||
## `dup`
|
||||
|
||||
```c
|
||||
char *Curl_bufref_dup(const struct bufref *br);
|
||||
```
|
||||
|
||||
Returns a strdup() version of the buffer. Note that this assumes that the
|
||||
bufref is null terminated.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue