From mboxrd@z Thu Jan 1 00:00:00 1970 From: list at eworm.de (Christian Hesse) Date: Tue, 28 Aug 2018 20:38:21 +0200 Subject: [PATCH 4/9] ui-log: ban strncpy() In-Reply-To: <20180828183826.25043-1-list@eworm.de> References: <20180828183826.25043-1-list@eworm.de> Message-ID: <20180828183826.25043-4-list@eworm.de> From: Christian Hesse Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse --- ui-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-log.c b/ui-log.c index c2f92fe..3bcb657 100644 --- a/ui-log.c +++ b/ui-log.c @@ -67,7 +67,7 @@ void show_commit_decorations(struct commit *commit) while (deco) { struct object_id peeled; int is_annotated = 0; - strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); + strlcpy(buf, prettify_refname(deco->name), sizeof(buf)); switch(deco->type) { case DECORATION_NONE: /* If the git-core doesn't recognize it,