diff --git a/include/pmtv/pmt.hpp b/include/pmtv/pmt.hpp index 024c6b8..7a83a87 100644 --- a/include/pmtv/pmt.hpp +++ b/include/pmtv/pmt.hpp @@ -261,9 +261,8 @@ std::streamsize _serialize(std::streambuf& sb, const T& arg) { char one = 1; char zero = 0; for (auto value : arg) { - sb.sputn(value ? &one : &zero, sizeof(char)); + length += sb.sputn(value ? &one : &zero, sizeof(char)); } - length += arg.size() * sizeof(char); return length; } template