[前][次][番号順一覧][スレッド一覧]

ruby-changes:44481

From: mrkn <ko1@a...>
Date: Fri, 4 Nov 2016 13:05:13 +0900 (JST)
Subject: [ruby-changes:44481] mrkn:r56554 (trunk): numeric.c (rb_int_digits): Fix exception message

mrkn	2016-11-04 13:05:07 +0900 (Fri, 04 Nov 2016)

  New Revision: 56554

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56554

  Log:
    numeric.c (rb_int_digits): Fix exception message

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 56553)
+++ ChangeLog	(revision 56554)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Nov  4 13:03:00 2016  Kenta Murata  <mrkn@m...>
+
+	* numeric.c (rb_int_digits): Fix exception message
+
 Fri Nov  4 10:51:16 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/pathname/pathname.c (path_hash): fix unnormalized Fixnum
Index: numeric.c
===================================================================
--- numeric.c	(revision 56553)
+++ numeric.c	(revision 56554)
@@ -4680,7 +4680,9 @@ rb_int_digits(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/numeric.c#L4680
             return rb_int_digits_bigbase(num, base_value);
 
         base = FIX2LONG(base_value);
-        if (base < 2)
+        if (base < 0)
+            rb_raise(rb_eArgError, "negative radix");
+        else if (base < 2)
             rb_raise(rb_eArgError, "invalid radix %ld", base);
     }
     else

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]