Added assert. Thanks to Jean-Pierre Münch for the suggestion
parent
da68ad21a2
commit
e9c086aaac
6
misc.h
6
misc.h
|
|
@ -379,8 +379,10 @@ template <class T1, class T2>
|
||||||
inline bool SafeConvert(T1 from, T2 &to)
|
inline bool SafeConvert(T1 from, T2 &to)
|
||||||
{
|
{
|
||||||
to = (T2)from;
|
to = (T2)from;
|
||||||
if (from != to || (from > 0) != (to > 0))
|
if (from != to || (from > 0) != (to > 0)) {
|
||||||
return false;
|
CRYPTOPP_ASSERT(false); return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue