deprecate sprint and replace with snprintf

This commit is contained in:
Arnaud Loonstra
2023-01-24 12:54:48 +01:00
parent b674ce68d0
commit f7df6c8599
11 changed files with 41 additions and 31 deletions

View File

@@ -129,7 +129,8 @@ static std::string make_address_string (const char *hbuf_,
pos += hbuf_len;
memcpy (pos, ipv6_suffix_, sizeof ipv6_suffix_ - 1);
pos += sizeof ipv6_suffix_ - 1;
pos += sprintf (pos, "%d", ntohs (port_));
pos += snprintf (pos, max_port_str_length + 1 * sizeof (char), "%d",
ntohs (port_));
return std::string (buf, pos - buf);
}