Avoid modulo 0 Coverity pointed out that 'size' might be 0 (even if the 'find()' would detect this). This commit fixes this and avoids entering 'find()' at all.
Mathias Gumz akira@fluxbox.org
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
src/FbTk/Container.cc
→
src/FbTk/Container.cc
@@ -94,6 +94,10 @@ }
void Container::moveItem(Item item, int movement) { + if (m_item_list.empty()) { + return; + } + int index = find(item); const size_t size = m_item_list.size();