summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r--src/corelib/text/qstring.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h
index 7daf86a366..d86d659e75 100644
--- a/src/corelib/text/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -1167,7 +1167,7 @@ inline QString::~QString() {}
inline void QString::reserve(qsizetype asize)
{
- if (d->needsDetach() || asize >= capacity())
+ if (d->needsDetach() || asize >= capacity() - d.freeSpaceAtBegin())
reallocData(uint(qMax(asize, size())) + 1u, d->detachFlags());
// we're not shared anymore, for sure