diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp index 129d3b64..841d5f5d 100644 --- a/src/net/maildir/maildirFolder.cpp +++ b/src/net/maildir/maildirFolder.cpp @@ -1264,8 +1264,8 @@ void maildirFolder::expunge() if (!nums.empty()) { - for (std::vector ::size_type i = nums.size() - 1 ; i >= 0 ; --i) - m_messageInfos.erase(m_messageInfos.begin() + i); + for (std::vector ::size_type i = nums.size() ; i != 0 ; --i) + m_messageInfos.erase(m_messageInfos.begin() + (i - 1)); } m_messageCount -= nums.size();