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

This should help with portability for the protocol family eventually.
This commit is contained in:
Pierre Pronchery 2018-07-09 17:58:26 +02:00
parent baed23c50c
commit f61a3085f0

View File

@ -225,8 +225,8 @@ run_tcp_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, "tcp_server: Got TCP connection from %s.", sipbuf);
}