strbuf_split_buf(): use ALLOC_GROW()
authorMichael Haggerty <mhagger@alum.mit.edu>
Sun, 4 Nov 2012 06:46:51 +0000 (07:46 +0100)
committerJeff King <peff@peff.net>
Sun, 4 Nov 2012 11:46:55 +0000 (06:46 -0500)
commitb8c2c1fa35f240ea8eee719c0f5a657285864573
treebdc22ab0485418b9ef905a580ef2543e92081d6d
parent9c50374497d5a3259907e32455f228cfbda85ddf
strbuf_split_buf(): use ALLOC_GROW()

Use ALLOC_GROW() rather than inline code to manage memory in
strbuf_split_buf().  Rename "pos" to "nr" because it better describes
the use of the variable and it better conforms to the "ALLOC_GROW"
idiom.

Also, instead of adding a sentinal NULL value after each entry is
added to the list, only add it once after all of the entries have been
added.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
strbuf.c