Check that LOGGER macros are only called with string literals.

Avoid any dynamic format strings, even ones like `cond ? "str1" : "str2"`.
This commit is contained in:
iphydf 2020-03-18 13:42:50 +00:00
parent 1b7bf5b182
commit 36cb30d47d
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -871,8 +871,13 @@ Networking_Core *new_networking_ex(const Logger *log, IP ip, uint16_t port_from,
int neterror = net_error(); int neterror = net_error();
const char *strerror = net_new_strerror(neterror); const char *strerror = net_new_strerror(neterror);
LOGGER_DEBUG(log, res < 0 ? "Failed to activate local multicast membership. (%d, %s)" :
"Local multicast group FF02::1 joined successfully. (%d, %s)", neterror, strerror); if (res < 0) {
LOGGER_DEBUG(log, "Failed to activate local multicast membership. (%d, %s)", neterror, strerror);
} else {
LOGGER_DEBUG(log, "Local multicast group FF02::1 joined successfully. (%d, %s)", neterror, strerror);
}
net_kill_strerror(strerror); net_kill_strerror(strerror);
} }