aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-10-09 18:25:55 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-10-09 18:25:55 (GMT)
commit4bab7afaa4943bb627c25ec4e55e383c39dd14bd (patch)
tree883091e77d993bb3681d6b7778f24f5ea8dd7a01
parent3301e993ada9fc794dcbba65e8ee28c1ebe5621a (diff)
downloadfluxbox-4bab7afaa4943bb627c25ec4e55e383c39dd14bd.zip
fluxbox-4bab7afaa4943bb627c25ec4e55e383c39dd14bd.tar.bz2
prevent range overflow
whenever dealing with unsigned, there's better no "-" in the line ...
-rw-r--r--src/FbTk/Container.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
index 0ddc421..6270c6a 100644
--- a/src/FbTk/Container.cc
+++ b/src/FbTk/Container.cc
@@ -404,7 +404,7 @@ void Container::repositionItems() {
404 for (int i = 0; i < buttonDemands.size(); ++i) { 404 for (int i = 0; i < buttonDemands.size(); ++i) {
405 if (buttonDemands.at(i) > thresh) { 405 if (buttonDemands.at(i) > thresh) {
406 int d = buttonDemands.at(i)*overhead/greed; 406 int d = buttonDemands.at(i)*overhead/greed;
407 if (buttonDemands.at(i) - d > mean) { 407 if (buttonDemands.at(i) > mean + d) {
408 buttonDemands.at(i) -= d; 408 buttonDemands.at(i) -= d;
409 } else { // do not shrink below mean or a huge item number would super-punish larger ones 409 } else { // do not shrink below mean or a huge item number would super-punish larger ones
410 d = buttonDemands.at(i) - mean; 410 d = buttonDemands.at(i) - mean;