[PATCH 01/10] pkt-line: use stack rather than static buffer in packet_write_gently()
- From
- Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jan 12, 2021, 15:31 UTC
- Message-ID
- <1155a45cf64afb237204429cd4ff2e74f5f7602a.1610465492.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.766.git.1610465492.gitgitgadget@gmail.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Teach packet_write_gently() to use a stack buffer rather than a static buffer when composing the packet line message. This helps get us ready for threaded operations.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> --- pkt-line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkt-line.c b/pkt-line.c index d633005ef74..98439a2fed0 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -196,7 +196,7 @@ int packet_write_fmt_gently(int fd, const char *fmt, ...) static int packet_write_gently(const int fd_out, const char *buf, size_t size) { - static char packet_write_buffer[LARGE_PACKET_MAX]; + char packet_write_buffer[LARGE_PACKET_MAX]; size_t packet_size; if (size > sizeof(packet_write_buffer) - 4)
-- gitgitgadget