Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte)
Subject: [lttng-dev] [PATCH lttng-tools] Fix: getenv can return null
Date: Tue, 30 Apr 2019 19:09:24 -0400	[thread overview]
Message-ID: <20190430230924.23711-1-jonathan.rajotte-julien@efficios.com> (raw)

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 <jonathan.rajotte-julien at efficios.com>
---
 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



                 reply	other threads:[~2019-04-30 23:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190430230924.23711-1-jonathan.rajotte-julien@efficios.com \
    --to=jonathan.rajotte-julien@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox