From 307cb84323c0dd699ff2e30e5cee07da933bc352 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Fri, 18 Jan 2013 22:11:32 -0500 Subject: [PATCH] port strlen bugfix --- client/spa_comm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/spa_comm.c b/client/spa_comm.c index 4ed9e58e..0716b70f 100644 --- a/client/spa_comm.c +++ b/client/spa_comm.c @@ -101,7 +101,7 @@ send_spa_packet_tcp_or_udp(const char *spa_data, const int sd_len, { int sock, res=0, error; struct addrinfo *result, *rp, hints; - char port_str[MAX_PORT_STR_LEN]; + char port_str[MAX_PORT_STR_LEN+1]; if (options->test) { @@ -130,7 +130,7 @@ send_spa_packet_tcp_or_udp(const char *spa_data, const int sd_len, hints.ai_protocol = IPPROTO_TCP; } - snprintf(port_str, MAX_PORT_STR_LEN, "%d", options->spa_dst_port); + snprintf(port_str, MAX_PORT_STR_LEN+1, "%d", options->spa_dst_port); error = getaddrinfo(options->spa_server_str, port_str, &hints, &result);