Fix use of template parameter as a condition

This commit is contained in:
Jeffrey Walton 2016-09-21 23:04:43 -04:00
parent 91020ce3ba
commit 933e63f162

View File

@ -438,10 +438,8 @@ T StringToValue(const std::string& str) {
if (iss.fail())
throw InvalidArgument("cryptest.exe: '" + str +"' is not a value");
#if NON_NEGATIVE
if (value < 0)
if (NON_NEGATIVE && value < 0)
throw InvalidArgument("cryptest.exe: '" + str +"' is negative");
#endif
return value;
}