From: Miroslav Lichvar Date: Wed, 21 Apr 2021 10:51:07 +0000 (+0200) Subject: sources: don't print NULL string to dump file X-Git-Tag: 4.1-pre1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e55fe69193abded07a9848a679921a83095c214;p=thirdparty%2Fchrony.git 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") --- diff --git a/sources.c b/sources.c index 68d81fe0..0d1bce5d 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,