From d4371267602b186e0fbd0d4ff48ec023f8187cda Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 28 Nov 2015 00:19:44 +0100 Subject: [PATCH] throw ConversionException if not all chars could be extracted --- conversion/stringconversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conversion/stringconversion.h b/conversion/stringconversion.h index da17a19..a474444 100644 --- a/conversion/stringconversion.h +++ b/conversion/stringconversion.h @@ -172,7 +172,7 @@ template LIB_EXPORT NumberType string std::basic_stringstream ss; ss << std::setbase(base) << string; NumberType result; - if(ss >> result) { + if((ss >> result) && ss.eof()) { return result; } else { throw ConversionException("The specified string is no valid number.");