diff options
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -44,7 +44,9 @@ void strbuf_release(struct strbuf *sb) char *strbuf_detach(struct strbuf *sb, size_t *sz) { - char *res = sb->alloc ? sb->buf : NULL; + char *res; + strbuf_grow(sb, 0); + res = sb->buf; if (sz) *sz = sb->len; strbuf_init(sb, 0); |