From f61a3085f04476e6318523e3833536cdb5f5fa54 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 9 Jul 2018 17:58:26 +0200 Subject: [PATCH] Use sizeof() instead of re-using hard-coded values This should help with portability for the protocol family eventually. --- server/tcp_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/tcp_server.c b/server/tcp_server.c index 6ae1dbe6..65a72e1b 100644 --- a/server/tcp_server.c +++ b/server/tcp_server.c @@ -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); }