* [PATCH] strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()
@ 2011-10-06 4:21 Brandon Casey
0 siblings, 0 replies; only message in thread
From: Brandon Casey @ 2011-10-06 4:21 UTC (permalink / raw)
To: git; +Cc: Brandon Casey
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 <drafnel@gmail.com>
---
strbuf.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/strbuf.c b/strbuf.c
index 9ff1b59..3ad2cc0 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;
--
1.7.7.1.ge3b6f
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-06 4:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 4:21 [PATCH] strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline() Brandon Casey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).