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: NMichael Haggerty <mhagger@alum.mit.edu> Signed-off-by: NJeff King <peff@peff.net>
Showing
想要评论请 注册 或 登录