]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Jul 2020 18:10:42 +0000 (03:10 +0900)
src/timedate/timedatectl.c

index 49d68d2533449ac85817718a1d2a47ced2e57d76..36b26874f0cc3f31c41730bd1978a17307fa13f9 100644 (file)
@@ -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);