all repos — fluxbox @ e37cad714c77b24e4421f5dc1b3d01fe685b637a

custom fork of the fluxbox windowmanager

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
commit

e37cad714c77b24e4421f5dc1b3d01fe685b637a

parent

ad8e6da8efe54e86792947285aaa5974e96d8628

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/FbTk/Container.ccsrc/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();