summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Scanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Scanner.l')
-rw-r--r--cpp/src/Slice/Scanner.l5
1 files changed, 2 insertions, 3 deletions
diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l
index 561575ff044..101d87e108a 100644
--- a/cpp/src/Slice/Scanner.l
+++ b/cpp/src/Slice/Scanner.l
@@ -318,10 +318,9 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e
{integer_constant} {
IntegerTokPtr itp = new IntegerTok;
*yylvalp = itp;
- errno = 0;
- itp->v = IceUtil::strToInt64(yytext, 0, 0);
- if(errno == ERANGE && (itp->v == IceUtil::Int64Min || itp->v == IceUtil::Int64Max))
+ if(!IceUtil::stringToInt64(string(yytext), itp->v))
{
+ assert(itp->v != 0);
string msg = "integer constant `";
msg += yytext;
msg += "' out of range";