clone_buf
Duplicates a buffer in a dynamically allocated space.
Format
char clone_buf ( char *str,
Arguments
str
A pointer to the buffer to be duplicated.
len
The number of bytes to be copied.
Description
One extra byte is always allocated at the end and is filled with zeros. If the
length is less than zero, the duplicate buffer length is set to zero. A buffer pointer
is always returned, unless there is a
Return Values
Null
Example
#include <esnmp.h>
char *str = "something nice";
char *copy;
copy = clone_buf(str, strlen(str));
int *len );
A
malloc
allocated buffer that contains a copy of the
original buffer is returned.
eSNMP API Routines
error.
malloc
error. Otherwise, the pointer to the
eSNMP API Routines 5–51
clone_buf
Need help?
Do you have a question about the Compaq TCP/IP Services for OpenVMS and is the answer not in the manual?
Questions and answers