[PATCH 11/31] refs.c: null terminate the string in copy_msg
- From
Ronnie Sahlberg <sahlberg@google.com>
- Date
- May 14, 2014, 22:13 UTC
- Message-ID
- <1400105610-21194-12-git-send-email-sahlberg@google.com>
- In-Reply-To
- <1400105610-21194-1-git-send-email-sahlberg@google.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> --- refs.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/refs.c b/refs.c index 5a5f9df..58bbf1b 100644 --- a/refs.c +++ b/refs.c @@ -2707,6 +2707,7 @@ static int copy_msg(char *buf, const char *msg) while (buf < cp && isspace(cp[-1])) cp--; *cp++ = '\n'; + *cp = 0; return cp - buf; }
-- 2.0.0.rc3.506.g3739a35