From 54476a60248dbba0ee7b69b8df5b4b160e78913f Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 6 May 2010 19:28:12 +0000 Subject: * ext/bigdecimal/bigdecimal.c (VpCtoV): fix to check overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/bigdecimal/bigdecimal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index ce311a6b12..9a3dec83d8 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4033,9 +4033,9 @@ VpCtoV(Real *a, const char *int_chr, U_LONG ni, const char *frac, U_LONG nf, con while(i < me) { es = e*((S_INT)BASE_FIG); e = e * 10 + exp_chr[i] - '0'; - if(es>e*((S_INT)BASE_FIG)) { + if(es > (S_INT)(e*BASE_FIG)) { exponent_overflow = 1; - e = es; + e = es; /* keep sign */ break; } ++i; -- cgit v1.2.3