summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-02 11:30:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-02 11:30:40 +0000
commit8abfebeda328051969c664a0a44a73b030737d9b (patch)
tree08daddca550394c954a1bdddc3d415f7d54dcb92 /string.c
parentdc3fbe6ea65935a5e08bd5a9e22b805c47a141dc (diff)
downloadruby-8abfebeda328051969c664a0a44a73b030737d9b.tar.gz
ruby-8abfebeda328051969c664a0a44a73b030737d9b.tar.xz
ruby-8abfebeda328051969c664a0a44a73b030737d9b.zip
* string.c (rb_str_sum): should use bignums when bits is greater
than or equals to sizeof(long)*CHAR_BITS. [ruby-dev:24395] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index c6e43fd21..ac87b8d68 100644
--- a/string.c
+++ b/string.c
@@ -4416,7 +4416,7 @@ rb_str_sum(argc, argv, str)
ptr = p = RSTRING(str)->ptr;
len = RSTRING(str)->len;
pend = p + len;
- if (bits > sizeof(long)*CHAR_BIT) {
+ if (bits >= sizeof(long)*CHAR_BIT) {
VALUE sum = INT2FIX(0);
while (p < pend) {