BUF_DUP(3) - Library Functions Manual
buf_dup - duplicate a string buffer
buf_dup(struct buf *b, const struct buf *src);
The pointer b must not contain data as it will be overriden and may be let unchanged as-is.
If the src buffer isn’t initialized (and contains a NULL data field) the destination buffer b is unchanged but the function returns 0.
Otherwise the buf_dup() function returns -1 in case of error and errno is set to indicate the error.
There wasn’t enough memory to duplicate the buffer.
The libbuf library was written by David Demelier <email@example.com>
macOS 12.3 - October 29, 2019-2022