function appends a character to a dynamically
allocated NUL-terminated buffer, reallocating the buffer as needed.
argument points to a variable containing either a pointer to
an existing buffer or
If the value of the variable pointed to by
a new buffer
argument point to variables used to hold the size
of the buffer and the length of the string it contains, respectively.
The final argument,
is the character that should be appended to
the string. If
is 0, nothing is appended, but a new buffer is
still allocated if
is NULL. This can be used to
If a new buffer is allocated or an existing buffer is reallocated to
make room for the additional character,
function ensures that the buffer is always
function is successful, it increments the
integer variable pointed to by
was 0) and returns 0.
Otherwise, it leaves the variables pointed to by
and returns -1.