Skip to content

Commit b8d9307

Browse files
committed
Merge branch 'sb/blame-color'
Code clean-up. * sb/blame-color: blame: prefer xsnprintf to strcpy for colors
2 parents b7d510e + 022d2ac commit b8d9307

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin/blame.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
10711071
find_alignment(&sb, &output_option);
10721072
if (!*repeated_meta_color &&
10731073
(output_option & OUTPUT_COLOR_LINE))
1074-
strcpy(repeated_meta_color, GIT_COLOR_CYAN);
1074+
xsnprintf(repeated_meta_color,
1075+
sizeof(repeated_meta_color),
1076+
"%s", GIT_COLOR_CYAN);
10751077
}
10761078
if (output_option & OUTPUT_ANNOTATE_COMPAT)
10771079
output_option &= ~(OUTPUT_COLOR_LINE | OUTPUT_SHOW_AGE_WITH_COLOR);

0 commit comments

Comments
 (0)