summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-11-22 22:04:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-11-22 22:04:41 +0100
commit77c279f879ba5c985bbbdb73bdcf95a7baacbd16 (patch)
tree3fdc505b1371171ea8191daa36be2585b3740f6e /qfunctionconfigurator
parente7fb0dce334fdb88470aaaaca63c2694cd05f847 (diff)
don't crash with x=2^31-1
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp
index a0715754..4f808c80 100644
--- a/qfunctionconfigurator/functionconfig.cpp
+++ b/qfunctionconfigurator/functionconfig.cpp
@@ -45,7 +45,7 @@ float Map::getValueInternal(int x) {
if (sz == 0)
ret = 0;
else
- ret = cur.data[std::max(std::min(x, sz-1), 0)];
+ ret = cur.data[std::min<unsigned>(x, sz-1)];
return ret * sign;
}