From: Brandon Casey Date: Thu, 6 Oct 2011 04:21:33 +0000 (-0500) Subject: strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline() X-Git-Tag: v1.7.7.1~12 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1844f8d591340bb43e4990c96afd0aba424adf48;p=git.git strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline() This use of strbuf_grow() is a historical artifact that was once used to ensure that strbuf.buf was allocated and properly nul-terminated. This was added before the introduction of the slopbuf in b315c5c0, which guarantees that strbuf.buf always points to a usable nul-terminated string. So let's remove it. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- diff --git a/strbuf.c b/strbuf.c index 9ff1b597c..3ad2cc001 100644 --- a/strbuf.c +++ b/strbuf.c @@ -357,7 +357,6 @@ int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term) { int ch; - strbuf_grow(sb, 0); if (feof(fp)) return EOF;