diff --git a/src/zstring.cpp b/src/zstring.cpp index 14d19f46f..510ff19d7 100644 --- a/src/zstring.cpp +++ b/src/zstring.cpp @@ -1096,7 +1096,7 @@ void FString::ReallocBuffer (size_t newlen) { // If more than one reference, we must use a new copy FStringData *old = Data(); AllocBuffer (newlen); - StrCopy (Chars, old->Chars(), old->Len); + StrCopy (Chars, old->Chars(), newlen < old->Len ? newlen : old->Len); old->Release(); } else