BUF_DUP(3) - Library Functions Manual

NAME

buf_dup - duplicate a string buffer

SYNOPSIS

#include <buf.h>

bool
buf_dup(struct buf *b, const struct buf *src);

DESCRIPTION

The pointer b must not contain data as it will be overriden and may be let unchanged as-is.

RETURN VALUE

If the src buffer isn’t initialized (and contains a NULL data field) the destination buffer b is unchanged but the function returns true.

Otherwise the buf_dup() function returns false in case of error and errno is set to indicate the error.

ERRORS

[ENOMEM]

There wasn’t enough memory to duplicate the buffer.

SEE ALSO

libbuf(3)

AUTHORS

The libbuf library was written by David Demelier <markand@malikania.fr>

macOS 11.2 - October 29, 2019-2020