Utils: Fix SmallString::append(QStringView string)

It used the size of the destination string but it had to use the size of
the appended string to inquire the maximum required size.

Change-Id: I1c910abab0ac60ed5fec1b3dc3a358e438532281
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Marco Bubke
2023-07-20 11:07:30 +02:00
parent 601308edcd
commit 21983a8377
2 changed files with 36 additions and 6 deletions

View File

@@ -455,7 +455,7 @@ public:
constexpr size_type temporaryArraySize = Size * 6;
size_type oldSize = size();
size_type maximumRequiredSize = static_cast<size_type>(encoder.requiredSpace(oldSize));
size_type maximumRequiredSize = static_cast<size_type>(encoder.requiredSpace(string.size()));
char *newEnd = nullptr;
if (maximumRequiredSize > temporaryArraySize) {