kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 0dcd6087cf3a7669ac49fbacdc2e4dbb3bab8833
parent ed8110f10977160a247d9369f5b6be5ed9e49225
Author: Joris Vink <joris@coders.se>
Date:   Mon, 18 Jan 2016 11:26:55 +0100

Add kore_buf_stringify().

NUL-terminates a kore_buf and returns a char pointer.

Diffstat:
src/buf.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/buf.c b/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) {