]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-log.c
ui-log: ban strncpy()
[cgit.git] / ui-log.c
index c2f92febc2ee67f91872a82c2b43018d6599a78b..3bcb657657e47265ffe499910a7508ad9323287f 100644 (file)
--- 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,