Merge branch 'ef/maint-strbuf-init'

* ef/maint-strbuf-init:
  config: support values longer than 1023 bytes
  strbuf: make sure buffer is zero-terminated
This commit is contained in:
Junio C Hamano
2011-04-27 11:36:43 -07:00
3 changed files with 12 additions and 12 deletions

View File

@ -30,8 +30,10 @@ void strbuf_init(struct strbuf *sb, size_t hint)
{
sb->alloc = sb->len = 0;
sb->buf = strbuf_slopbuf;
if (hint)
if (hint) {
strbuf_grow(sb, hint);
sb->buf[0] = '\0';
}
}
void strbuf_release(struct strbuf *sb)