mirror of https://git.kore.io/kore.git
Add kore_buf_stringify().
NUL-terminates a kore_buf and returns a char pointer.
This commit is contained in:
parent
ed8110f109
commit
0dcd6087cf
10
src/buf.c
10
src/buf.c
|
@ -88,6 +88,16 @@ kore_buf_appendf(struct kore_buf *buf, const char *fmt, ...)
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
char *
|
||||
kore_buf_stringify(struct kore_buf *buf)
|
||||
{
|
||||
char c;
|
||||
|
||||
c = '\0';
|
||||
kore_buf_append(buf, &c, sizeof(c));
|
||||
return ((char *)buf->data);
|
||||
}
|
||||
|
||||
u_int8_t *
|
||||
kore_buf_release(struct kore_buf *buf, u_int32_t *len)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue