diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-01 23:47:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-01 23:47:02 +0000 |
commit | 6a62b8e8037c3721e7f70dbe106da50df6fbfc37 (patch) | |
tree | 92539d8352b6c13dfb7b7515ef6d671e8cf0b803 /util.c | |
parent | 7c5e3348f7d4902ad8eb94d84a0a3595fbcd2ce2 (diff) |
* util.c (ruby_strtod, dtoa): initialize more variables for error
handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -5,7 +5,7 @@ $Author$ created at: Fri Mar 10 17:22:34 JST 1995 - Copyright (C) 1993-2007 Yukihiro Matsumoto + Copyright (C) 1993-2008 Yukihiro Matsumoto **********************************************************************/ @@ -48,7 +48,7 @@ ruby_scan_oct(const char *start, int len, int *retlen) unsigned long ruby_scan_hex(const char *start, int len, int *retlen) { - static char hexdigit[] = "0123456789abcdef0123456789ABCDEF"; + static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF"; register const char *s = start; register unsigned long retval = 0; char *tmp; @@ -2384,7 +2384,7 @@ ret0: #endif dval(rv) = tens[k - 9] * dval(rv) + z; } - bd0 = 0; + bd0 = bb = bd = bs = delta = 0; if (nd <= DBL_DIG #ifndef RND_PRODQUOT #ifndef Honor_FLT_ROUNDS @@ -3310,7 +3310,7 @@ dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) int denorm; ULong x; #endif - Bigint *b, *b1, *delta, *mlo, *mhi, *S; + Bigint *b, *b1, *delta, *mlo = 0, *mhi = 0, *S; double d2, ds, eps; char *s, *s0; #ifdef Honor_FLT_ROUNDS @@ -3663,7 +3663,6 @@ bump_up: m2 = b2; m5 = b5; - mhi = mlo = 0; if (leftright) { i = #ifndef Sudden_Underflow |