]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: don't print NULL string to dump file
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 21 Apr 2021 10:51:07 +0000 (12:51 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Apr 2021 08:20:31 +0000 (10:20 +0200)
For reference clocks, which don't have a name, print "." instead of
NULL.

Fixes: f8610d69f08f ("sources: improve handling of dump files and their format")
sources.c

index 68d81fe02277d497dc51d6c232e1b68c57b0169b..0d1bce5d5e690fb80af1fcbbc3dcbb37a669cd28 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -1368,7 +1368,7 @@ save_source(SRC_Instance inst)
   if (!f)
     return;
 
-  ntp_name = inst->type == SRC_NTP ? NSR_GetName(inst->ip_addr) : NULL;
+  ntp_name = inst->type == SRC_NTP ? NSR_GetName(inst->ip_addr) : ".";
 
   if (fprintf(f, "%s%s\n%d %o %d %d %d\n",
               DUMP_IDENTIFIER, ntp_name, inst->authenticated,