Fix stringish::simplified() for strings > 2Gi characters
If, after simplification, the result string would have been >2Gi characters in length, the code returned a shorter string, truncated mod INT_MAX, because the algorithm had not been ported to qsizetype. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-103531 Change-Id: I57cfed34e5c69406f8d3f2913962d006b4bc6bd0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
ab512adf12
commit
ec35efd7f2
@ -101,7 +101,7 @@ template <typename StringType> struct QStringAlgorithms
|
||||
if (ptr != dst && ptr[-1] == QChar::Space)
|
||||
--ptr;
|
||||
|
||||
int newlen = ptr - dst;
|
||||
qsizetype newlen = ptr - dst;
|
||||
if (isConst && newlen == str.size() && unmodified) {
|
||||
// nothing happened, return the original
|
||||
return str;
|
||||
|
Loading…
x
Reference in New Issue
Block a user