summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrsyuki <frsyuki@users.sourceforge.jp>2009-08-19 15:10:10 +0900
committerfrsyuki <frsyuki@users.sourceforge.jp>2009-08-19 15:10:10 +0900
commitb2381d0513e3ec9a874643b7faf7afeb4490a1e7 (patch)
treecf286bb4d152613e1327b1efb7e294ea3cd4cfde
parent92952f656691f5907e00c0a5ab45e3423d5429cb (diff)
downloadmsgpack-python-b2381d0513e3ec9a874643b7faf7afeb4490a1e7.tar.gz
cpp: fix overflow check for minimum number of signed integer type
-rw-r--r--cpp/type/int.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpp/type/int.hpp b/cpp/type/int.hpp
index 8fdc386..03500f7 100644
--- a/cpp/type/int.hpp
+++ b/cpp/type/int.hpp
@@ -37,7 +37,7 @@ namespace detail {
{ throw type_error(); }
return o.via.u64;
} else if(o.type == type::NEGATIVE_INTEGER) {
- if(o.via.i64 < (int64_t)-std::numeric_limits<T>::max())
+ if(o.via.i64 < (int64_t)std::numeric_limits<T>::min())
{ throw type_error(); }
return o.via.i64;
}