summaryrefslogtreecommitdiffstats
path: root/membuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'membuffer.c')
-rw-r--r--membuffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/membuffer.c b/membuffer.c
index fd179244b..8ba23ebe2 100644
--- a/membuffer.c
+++ b/membuffer.c
@@ -55,6 +55,13 @@ static void make_room(struct membuffer *b, unsigned int size)
}
}
+const char *mb_cstring(struct membuffer *b)
+{
+ make_room(b, 1);
+ b->buffer[b->len] = 0;
+ return b->buffer;
+}
+
void put_bytes(struct membuffer *b, const char *str, int len)
{
make_room(b, len);