print empty string instead of null in ipv6 lease file

see #725
This commit is contained in:
Thomas Bernard 2024-04-18 00:58:45 +02:00
parent db6f9968fe
commit 74c5568d15
1 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,12 @@ lease_file6_add(const char * rem_client,
if (timestamp != 0) {
timestamp -= upnp_time();
}
if (rem_client == NULL) {
rem_client = "";
}
if (desc == NULL) {
desc = "";
}
fprintf(fd, "%s;%s;%hu;%s;%hu;%u;%u;%s\n",
proto_itoa(proto), int_client, int_port, rem_client, rem_port,