{"thread":{"id":"28600","subject":"[PATCH] strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()","startedAt":"2011-10-06T04:21:33Z","lastAt":"2011-10-06T04:21:33Z","messageCount":1,"participants":["Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177003","messageId":"1317874893-4167-1-git-send-email-drafnel@gmail.com","threadId":"28600","inReplyTo":null,"subject":"[PATCH] strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2011-10-06T04:21:33Z","receivedAt":"2011-10-06T04:21:33Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"This use of strbuf_grow() is a historical artifact that was once used to\nensure that strbuf.buf was allocated and properly nul-terminated.  This\nwas added before the introduction of the slopbuf in b315c5c0, which\nguarantees that strbuf.buf always points to a usable nul-terminated string.\nSo let's remove it.\n\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n strbuf.c |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/strbuf.c b/strbuf.c\nindex 9ff1b59..3ad2cc0 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -357,7 +357,6 @@ int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)\n {\n \tint ch;\n \n-\tstrbuf_grow(sb, 0);\n \tif (feof(fp))\n \t\treturn EOF;\n \n-- \n1.7.7.1.ge3b6f\n"}]}