From mboxrd@z Thu Jan 1 00:00:00 1970 From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte) Date: Tue, 30 Apr 2019 19:09:24 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: getenv can return null Message-ID: <20190430230924.23711-1-jonathan.rajotte-julien@efficios.com> 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 --- src/common/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.17.1