bufref: rename *memdup() to *memdup0()

To make it clearer to readers of the code that the resulting dup also
has a null terminator. Something a "normal" memdup() does not provide.

Closes #19833
This commit is contained in:
Daniel Stenberg 2025-12-04 16:20:25 +01:00
parent fe7703a0b3
commit 1def380032
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 20 additions and 19 deletions

View file

@ -54,10 +54,11 @@ specified as `NULL`: this is the case when the referenced buffer is static.
if `buffer` is NULL, `length` must be zero.
## `memdup`
## `memdup0`
```c
CURLcode Curl_bufref_memdup(struct bufref *br, const void *data, size_t length);
CURLcode Curl_bufref_memdup0(struct bufref *br, const void *data,
size_t length);
```
Releases the previously referenced buffer, then duplicates the `length`-byte