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:
Miroslav Lichvar
2020-05-20 16:20:43 +02:00
parent e555548dda
commit 60049f1551
5 changed files with 21 additions and 25 deletions

View File

@@ -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;