From 38241c15b80790efb11b1c128a3277900a89191b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 23 Nov 2012 01:27:17 -0500 Subject: sb_efuncs: fix NOCOLOR handling Need to set the colors to "" rather than NULL so we don't print out "(null)" where the colors normally would be. Signed-off-by: Mike Frysinger --- libsbutil/sb_efuncs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsbutil/sb_efuncs.c b/libsbutil/sb_efuncs.c index 248c2bd..5a86d25 100644 --- a/libsbutil/sb_efuncs.c +++ b/libsbutil/sb_efuncs.c @@ -44,8 +44,11 @@ const char *colors[] = { __attribute__((constructor)) static void sbio_init(void) { - if (is_env_on(ENV_NOCOLOR)) - memset(colors, 0, sizeof(colors)); + if (is_env_on(ENV_NOCOLOR)) { + size_t i; + for (i = 0; i < ARRAY_SIZE(colors); ++i) + colors[i] = ""; + } } static bool try_portage_helpers = false; -- cgit v1.2.3