0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 16:34:13 +01:00

ircd::http: Elide the strlcat() for user header generation.

This commit is contained in:
Jason Volk 2017-10-03 04:01:52 -07:00
parent 0399ddf3e3
commit 5335371b1a

View file

@ -344,17 +344,15 @@ ircd::http::request::request(const string_view &host,
content.size()) content.size())
}; };
char user_headers[printed_size(headers) + 2 + 1]; auto user_headers_len char user_headers[printed_size(headers) + 2]; auto user_headers_len
{ {
print(user_headers, sizeof(user_headers), headers) print(user_headers, sizeof(user_headers), headers)
}; };
static const auto &terminator assert(user_headers_len + 3 == sizeof(user_headers));
{ user_headers[user_headers_len++] = '\r';
"\r\n" user_headers[user_headers_len++] = '\n';
}; //user_headers[user_headers_len++] = '\0';
user_headers_len = strlcat(user_headers, terminator, sizeof(user_headers));
const ilist<const_buffer> vector const ilist<const_buffer> vector
{ {