mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 20:15:07 -05:00
conf: replace empty strings with NULL
Avoid mixing empty strings with NULLs in configuration strings to make the handling of default or disabled values consistent.
This commit is contained in:
@@ -1284,9 +1284,8 @@ FILE *open_dumpfile(SRC_Instance inst, char mode)
|
||||
char filename[64], *dumpdir;
|
||||
|
||||
dumpdir = CNF_GetDumpDir();
|
||||
if (dumpdir[0] == '\0') {
|
||||
if (!dumpdir)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Include IP address in the name for NTP sources, or reference ID in hex */
|
||||
if (inst->type == SRC_NTP && UTI_IsIPReal(inst->ip_addr))
|
||||
@@ -1350,7 +1349,7 @@ SRC_RemoveDumpFiles(void)
|
||||
size_t i;
|
||||
|
||||
dumpdir = CNF_GetDumpDir();
|
||||
if (dumpdir[0] == '\0' ||
|
||||
if (!dumpdir ||
|
||||
snprintf(pattern, sizeof (pattern), "%s/*.dat", dumpdir) >= sizeof (pattern))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user