From: Jeff King Date: Thu, 24 Sep 2015 21:08:21 +0000 (-0400) Subject: color: add color_set helper for copying raw colors X-Git-Tag: v2.7.0-rc0~87^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7ce4fb948c6d196a376a37840cb80ae95b5897ec?ds=sidebyside;hp=7ce4fb948c6d196a376a37840cb80ae95b5897ec color: add color_set helper for copying raw colors To set up default colors, we sometimes strcpy() from the default string literals into our color buffers. This isn't a bug (assuming the destination is COLOR_MAXLEN bytes), but makes it harder to audit the code for problematic strcpy calls. Let's introduce a color_set which copies under the assumption that there are COLOR_MAXLEN bytes in the destination (of course you can call it on a smaller buffer, so this isn't providing a huge amount of safety, but it's more convenient than calling xsnprintf yourself). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---