Skip to content

Commit 1844f8d

Browse files
drafnelgitster
authored andcommitted
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 b315c5c, which guarantees that strbuf.buf always points to a usable nul-terminated string. So let's remove it. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16b3b2d commit 1844f8d

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

strbuf.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)
357357
{
358358
int ch;
359359

360-
strbuf_grow(sb, 0);
361360
if (feof(fp))
362361
return EOF;
363362

0 commit comments

Comments
 (0)