0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

ircd::http: Fix serial size case with empty vector.

This commit is contained in:
Jason Volk 2018-03-04 23:45:59 -08:00
parent 3b1cc75f10
commit 96eca6c744

View file

@ -767,8 +767,7 @@ ircd::http::serialized(const vector_view<const header> &headers)
{
// Because the write(header) functions use fmt::sprintf we have to
// indicate an extra space for a null string terminator to not overlof
static const size_t initial{1};
const size_t initial{!headers.empty()};
return std::accumulate(std::begin(headers), std::end(headers), initial, []
(auto &ret, const auto &pair)
{