summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-18 15:32:36 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-18 15:32:36 +0000
commitdbd68031e02e0933601d6f247581aeb2d08766e5 (patch)
tree68c151b1559b2cc3d957e93e1abe5968b57efd2b /numeric.c
parent2513550e28e9cb47d581e652c68b89095f615f71 (diff)
* numeric.c (check_uint): fix wrong message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/numeric.c b/numeric.c
index 2b4d958a68..2b5890c9cb 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1588,23 +1588,17 @@ static void
check_uint(VALUE num, VALUE sign)
{
static const VALUE mask = ~(VALUE)UINT_MAX;
- const char *s;
if (RTEST(sign)) {
/* minus */
if ((num & mask) != mask || (num & ~mask) <= INT_MAX + 1UL)
- s = "small";
- else
- return;
+ rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too small to convert to `unsigned int'", num);
}
else {
/* plus */
if ((num & mask) != 0)
- s = "big";
- else
- return;
+ rb_raise(rb_eRangeError, "integer %"PRIuVALUE " too big to convert to `unsigned int'", num);
}
- rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too %s to convert to `unsigned int'", num, s);
}
long