diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index b795bbc86e..333ce72849 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -639,7 +639,7 @@ inline void QList::move(int from, int to) template Q_OUTOFLINE_TEMPLATE QList QList::mid(int pos, int alength) const { - if (alength < 0 || pos + alength > size()) + if (alength < 0 || pos > size() - alength) alength = size() - pos; if (pos == 0 && alength == size()) return *this;