diff options
Diffstat (limited to 'src/strbuf.c')
-rw-r--r-- | src/strbuf.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/strbuf.c b/src/strbuf.c index 7c8b965d..97c451c1 100644 --- a/src/strbuf.c +++ b/src/strbuf.c @@ -1,6 +1,3 @@ -#ifndef foostrbufhfoo -#define foostrbufhfoo - #include <sys/types.h> #include <stdlib.h> #include <assert.h> @@ -55,6 +52,14 @@ char *strbuf_tostring(struct strbuf *sb) { return t; } +char *strbuf_tostring_free(struct strbuf *sb) { + char *t; + assert(sb); + t = strbuf_tostring(sb); + strbuf_free(sb); + return t; +} + void strbuf_puts(struct strbuf *sb, const char *t) { struct chunk *c; size_t l; @@ -118,5 +123,3 @@ int strbuf_printf(struct strbuf *sb, const char *format, ...) { size *= 2; } } - -#endif |