From 96ecfa791e1f81c470fe39dff6327f6fad889e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Gro=C3=9F?= <21310755+vimpostor@users.noreply.github.com> Date: Tue, 4 Jul 2023 01:02:25 +0200 Subject: [PATCH] Fix compiler warning about mismatched signedness (#104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an addendum to 4eccdce7d9976256defb8dc9090b0085e851c398 It also makes the implementation consistent with the other serialize implementations in the same file. Signed-off-by: Magnus Groß --- include/pmtv/pmt.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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