port strlen bugfix

This commit is contained in:
Michael Rash
2013-01-18 22:11:32 -05:00
parent 47ea800889
commit 307cb84323
+2 -2
View File
@@ -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);