timedatectl: do not show (null) if the address of NTP server is not resolved
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Jul 2020 17:56:29 +0000 (02:56 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 20 Sep 2020 09:10:23 +0000 (11:10 +0200)
(cherry picked from commit 94ec163ad270e89be29bccc5d5edf1b038a29eae)

src/timedate/timedatectl.c

index 84962248481e9960d7b1a57982dae711203be5c3..760028e3cb966be520f78576cda5eb19ce441578 100644 (file)
@@ -431,7 +431,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);