Commit bba85c71 authored by Dominik Charousset's avatar Dominik Charousset

Merge pull request #1370

parents 598bb3e2 ef9fe1fd
...@@ -267,7 +267,7 @@ bool interfaces::get_endpoint(const std::string& host, uint16_t port, ...@@ -267,7 +267,7 @@ bool interfaces::get_endpoint(const std::string& host, uint16_t port,
addrinfo hint; addrinfo hint;
// max port is 2^16 which needs 5 characters plus null terminator // max port is 2^16 which needs 5 characters plus null terminator
char port_hint[6]; char port_hint[6];
sprintf(port_hint, "%hu", port); snprintf(port_hint, sizeof port_hint, "%hu", port);
memset(&hint, 0, sizeof(hint)); memset(&hint, 0, sizeof(hint));
hint.ai_socktype = SOCK_DGRAM; hint.ai_socktype = SOCK_DGRAM;
if (preferred) if (preferred)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment