提交 2cfceefa 编写于 作者: J Jeff King

Merge branch 'jk/strbuf-detach-always-non-null'

* jk/strbuf-detach-always-non-null:
  strbuf: always return a non-NULL value from strbuf_detach
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册