diff --git a/include/ehs/Serializer.h b/include/ehs/Serializer.h index 594500a..78b6658 100644 --- a/include/ehs/Serializer.h +++ b/include/ehs/Serializer.h @@ -1071,7 +1071,9 @@ namespace ehs template Str ReadStr(O size = 0) { - if (!size) + bool sizeKnown = size; + + if (!sizeKnown) while (&data[offset + sizeof(T) * size]) size++; @@ -1096,7 +1098,10 @@ namespace ehs Util::Copy(&result[0], &data[offset], result.Size(true)); } - offset += result.Size(true) + 1; + offset += result.Size(true); + + if (!sizeKnown) + offset++; return result; }