diff --git a/includes/kore.h b/includes/kore.h index 97cc775..91a8d80 100644 --- a/includes/kore.h +++ b/includes/kore.h @@ -576,6 +576,7 @@ void kore_buf_free(struct kore_buf *); struct kore_buf *kore_buf_create(u_int32_t); void kore_buf_append(struct kore_buf *, const void *, u_int32_t); u_int8_t *kore_buf_release(struct kore_buf *, u_int32_t *); +void kore_buf_reset(struct kore_buf *); void kore_buf_appendf(struct kore_buf *, const char *, ...); void kore_buf_appendv(struct kore_buf *, const char *, va_list); diff --git a/src/buf.c b/src/buf.c index 3bbff9c..1619e23 100644 --- a/src/buf.c +++ b/src/buf.c @@ -140,3 +140,9 @@ kore_buf_replace_string(struct kore_buf *b, char *src, void *dst, size_t len) off = off + len; } } + +void +kore_buf_reset(struct kore_buf *buf) +{ + buf->offset = 0; +}