strlcat(*url_str, url->host, HTTP_URL_MAXLEN);
if (url->port) {
- char port_str[8] = {0};
+ char port_str[8];
- snprintf(port_str, lenof(port_str), "%d", (int) url->port);
+ snprintf(port_str, sizeof(port_str), "%d", (int) url->port);
strlcat(*url_str, ":", HTTP_URL_MAXLEN);
strlcat(*url_str, port_str, HTTP_URL_MAXLEN);
}