From: Yu Watanabe Date: Thu, 16 Jul 2020 17:56:29 +0000 (+0900) Subject: timedatectl: do not show (null) if the address of NTP server is not resolved X-Git-Tag: v246~2^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94ec163ad270e89be29bccc5d5edf1b038a29eae;p=thirdparty%2Fsystemd.git timedatectl: do not show (null) if the address of NTP server is not resolved --- diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 49d68d25334..36b26874f0c 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -409,7 +409,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) { if (r < 0) return table_log_add_error(r); - r = table_add_cell_stringf(table, NULL, "%s (%s)", i->server_address, i->server_name); + r = table_add_cell_stringf(table, NULL, "%s (%s)", strna(i->server_address), strna(i->server_name)); if (r < 0) return table_log_add_error(r);