Merge branch 'sb/blame-color' into jk/banned-function
authorJunio C Hamano <gitster@pobox.com>
Fri, 20 Jul 2018 21:42:53 +0000 (14:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Jul 2018 16:05:35 +0000 (09:05 -0700)
* sb/blame-color:
  blame: prefer xsnprintf to strcpy for colors

builtin/blame.c

index 921d127..468b17c 100644 (file)
@@ -1071,7 +1071,9 @@ parse_done:
                find_alignment(&sb, &output_option);
                if (!*repeated_meta_color &&
                    (output_option & OUTPUT_COLOR_LINE))
-                       strcpy(repeated_meta_color, GIT_COLOR_CYAN);
+                       xsnprintf(repeated_meta_color,
+                                 sizeof(repeated_meta_color),
+                                 "%s", GIT_COLOR_CYAN);
        }
        if (output_option & OUTPUT_ANNOTATE_COMPAT)
                output_option &= ~(OUTPUT_COLOR_LINE | OUTPUT_SHOW_AGE_WITH_COLOR);