summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-05 05:22:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-05 05:22:17 +0000
commit39787ea14db33dd4265d7f6271cd2d59ccaeff37 (patch)
tree49743edd8a3dbb4fa4cfea6c472f3398edfe0639 /bignum.c
parent413db1b036083f76a2b34895af3c8a3204e174f2 (diff)
* numeric.c (fix_to_s): avoid rb_scan_args() when no argument
given. * bignum.c (rb_big_to_s): ditto. * enum.c (enum_first): ditto. * eval_jump.c (rb_f_catch): ditto. * io.c (rb_obj_display): ditto. * class.c (rb_obj_singleton_methods): ditto. * object.c (rb_class_initialize): ditto. * random.c (rb_f_srand): ditto. * range.c (range_step): ditto. * re.c (rb_reg_s_last_match): ditto. * string.c (rb_str_to_i): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_sum): ditto. * string.c (str_modifiable): declare inline. * string.c (str_independent): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bignum.c b/bignum.c
index 649b258c53..3a7dbe83b0 100644
--- a/bignum.c
+++ b/bignum.c
@@ -987,12 +987,15 @@ rb_big2str(VALUE x, int base)
static VALUE
rb_big_to_s(int argc, VALUE *argv, VALUE x)
{
- VALUE b;
int base;
- rb_scan_args(argc, argv, "01", &b);
if (argc == 0) base = 10;
- else base = NUM2INT(b);
+ else {
+ VALUE b;
+
+ rb_scan_args(argc, argv, "01", &b);
+ base = NUM2INT(b);
+ }
return rb_big2str(x, base);
}