Add kore_buf_stringify().

NUL-terminates a kore_buf and returns a char pointer.
This commit is contained in:
Joris Vink 2016-01-18 11:26:55 +01:00
parent ed8110f109
commit 0dcd6087cf
1 changed files with 10 additions and 0 deletions

View File

@ -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)
{