From 3e55fe69193abded07a9848a679921a83095c214 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 21 Apr 2021 12:51:07 +0200 Subject: [PATCH] sources: don't print NULL string to dump file 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources.c b/sources.c index 68d81fe..0d1bce5 100644 --- 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,