summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-08-19 13:56:27 +0200
committerDaniel Mack <github@zonque.org>2015-08-19 13:56:27 +0200
commit9a8e6b02140d411b2b6699187c9a8ed00075942d (patch)
tree4f38d39640288b835b328f12e6132319b9e7bf1f
parent4105232edccf0b02e7376a6877d29f3ddf512082 (diff)
parent8c4fa32acf82c9567554268d13e2fecb2f18813c (diff)
Merge pull request #993 from xnox/timedate
timedatectl: assert timezone is not null in setenv() call.
-rw-r--r--src/timedate/timedatectl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 240578bca0..8ec6adb493 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -96,7 +96,7 @@ static void print_status_info(const StatusInfo *i) {
old_tz = strdupa(tz);
/* Set the new $TZ */
- if (setenv("TZ", i->timezone, true) < 0)
+ if (i->timezone && setenv("TZ", i->timezone, true) < 0)
log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m");
else
tzset();