summaryrefslogtreecommitdiff
path: root/include/o3tl
diff options
context:
space:
mode:
Diffstat (limited to 'include/o3tl')
-rw-r--r--include/o3tl/safeint.hxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx
index 8b735fe2edfa..47baccf067f8 100644
--- a/include/o3tl/safeint.hxx
+++ b/include/o3tl/safeint.hxx
@@ -37,8 +37,8 @@ typename std::enable_if<std::is_signed<T>::value, T>::type saturating_add(
return std::numeric_limits<T>::max();
}
} else {
- if (a >= std::numeric_limits<T>::min() + b) {
- return a - b;
+ if (a >= std::numeric_limits<T>::min() - b) {
+ return a + b;
} else {
return std::numeric_limits<T>::min();
}