Use sizeof() instead of re-using hard-coded values

This should help with portability for the protocol family eventually.
This commit is contained in:
2018-07-18 00:20:01 +02:00
parent a7ecf432dd
commit d1625c71ad
+2 -2
View File
@@ -193,8 +193,8 @@ run_udp_server(fko_srv_options_t *opts)
if(opts->verbose)
{
memset(sipbuf, 0x0, MAX_IPV4_STR_LEN);
inet_ntop(AF_INET, &(caddr.sin_addr.s_addr), sipbuf, MAX_IPV4_STR_LEN);
memset(sipbuf, 0x0, sizeof(sipbuf));
inet_ntop(AF_INET, &(caddr.sin_addr.s_addr), sipbuf, sizeof(sipbuf));
log_msg(LOG_INFO, "udp_server: Got UDP datagram (%d bytes) from: %s",
pkt_len, sipbuf);
}