diff --git a/src/kits/support/String.cpp b/src/kits/support/String.cpp index 042f5e8c10..9358e743a4 100644 --- a/src/kits/support/String.cpp +++ b/src/kits/support/String.cpp @@ -1419,7 +1419,7 @@ BString::LockBuffer(int32 maxLength) { int32 length = Length(); if (maxLength > length) - length += maxLength - length; + length = maxLength; if (_DetachWith(fPrivateData, length) == B_OK) { _ReferenceCount() = -1;