ui-log: ban strncpy()

Git upstream bans strncpy() with commit:

  banned.h: mark strncpy() as banned
  e488b7aba743d23b830d239dcc33d9ca0745a9ad

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2018-08-28 18:16:11 +02:00
父節點 71ba7187e5
當前提交 7f75647b55
共有 1 個文件被更改,包括 1 次插入1 次删除

查看文件

@ -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,