diff options
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index eb06bd4713..03b10903ab 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1854,7 +1854,7 @@ QByteArray &QByteArray::remove(int pos, int len) if (len <= 0 || uint(pos) >= uint(d->size)) return *this; detach(); - if (pos + len >= d->size) { + if (len >= d->size - pos) { resize(pos); } else { memmove(d->data() + pos, d->data() + pos + len, d->size - pos - len); |