summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
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 d2fdc44806..0cadd61fe2 100644
--- a/string.c
+++ b/string.c
@@ -2478,7 +2478,7 @@ rb_str_count(argc, argv, str)
}
s = RSTRING(str)->ptr;
- if (!s || RSTRING(str)->len == 0) return Qnil;
+ if (!s || RSTRING(str)->len == 0) return INT2FIX(0);
send = s + RSTRING(str)->len;
i = 0;
while (s < send) {