From: Jonathan Rajotte Date: Tue, 30 Apr 2019 23:09:24 +0000 (-0400) Subject: Fix: getenv can return null X-Git-Tag: v2.12.0-rc1~596 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=0731b11e5e0022379ca462b574743197c48cfa25 Fix: getenv can return null On system with LANG not defined getenv will return null. An example of such system is the lava runner used by ci.lttng.org. https://ci.lttng.org/view/System%20Tests/ Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/time.c b/src/common/time.c index 5519e3ab4..a01c16df5 100644 --- a/src/common/time.c +++ b/src/common/time.c @@ -76,7 +76,7 @@ void __attribute__((constructor)) init_locale_utf8_support(void) if (program_locale && strstr(program_locale, "utf8")) { utf8_output_supported = true; - } else if (strstr(lang, "utf8")) { + } else if (lang && strstr(lang, "utf8")) { utf8_output_supported = true; } }