diff options
author | Mathias Gumz <akira@fluxbox.org> | 2015-01-16 09:47:01 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2015-01-16 09:47:01 (GMT) |
commit | e37cad714c77b24e4421f5dc1b3d01fe685b637a (patch) | |
tree | 19ff33c36e5b9cc53bc65d327880344cf5a89fbb /src | |
parent | ad8e6da8efe54e86792947285aaa5974e96d8628 (diff) | |
download | fluxbox-e37cad714c77b24e4421f5dc1b3d01fe685b637a.zip fluxbox-e37cad714c77b24e4421f5dc1b3d01fe685b637a.tar.bz2 |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Container.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc index 9ccae92..99afb75 100644 --- a/src/FbTk/Container.cc +++ b/src/FbTk/Container.cc | |||
@@ -94,6 +94,10 @@ void Container::insertItem(Item item, int pos) { | |||
94 | 94 | ||
95 | void Container::moveItem(Item item, int movement) { | 95 | void Container::moveItem(Item item, int movement) { |
96 | 96 | ||
97 | if (m_item_list.empty()) { | ||
98 | return; | ||
99 | } | ||
100 | |||
97 | int index = find(item); | 101 | int index = find(item); |
98 | const size_t size = m_item_list.size(); | 102 | const size_t size = m_item_list.size(); |
99 | 103 | ||