summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 2e9c1fb801..a6bb6afe57 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1433,7 +1433,7 @@ void QByteArray::resize(int size)
if (d->ref.isShared() || size > int(d->alloc)
|| (!d->capacityReserved && size < d->size && size < int(d->alloc) >> 1))
reallocData(size, true);
- if (int(d->alloc) >= size) {
+ if (d->alloc) {
d->size = size;
d->data()[size] = '\0';
}
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index e6a4826c2c..5e69a13057 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1243,7 +1243,7 @@ void QString::resize(int size)
if (d->ref.isShared() || size > int(d->alloc) ||
(!d->capacityReserved && size < d->size && size < int(d->alloc) >> 1))
reallocData(size, true);
- if (int(d->alloc) >= size) {
+ if (d->alloc) {
d->size = size;
d->data()[size] = '\0';
}