From b4674bd94c0137ee48414618499357bdf9cd6742 Mon Sep 17 00:00:00 2001 From: karutoh Date: Sat, 17 Feb 2024 00:57:33 -0800 Subject: [PATCH] Fixed Serializer::WriteStr. --- include/ehs/Serializer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ehs/Serializer.h b/include/ehs/Serializer.h index 3de251c..e3e1c12 100644 --- a/include/ehs/Serializer.h +++ b/include/ehs/Serializer.h @@ -405,7 +405,9 @@ namespace ehs inSize++; N bSize = sizeof(T) * inSize; - N bSizeN = sizeof(T) * (inSize + 1); + N bSizeN = bSize; + if (!sizeKnown) + bSizeN += sizeof(T); if (bSizeN > size - offset) {