aboutsummaryrefslogtreecommitdiffstats
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 3f0e69689c..77f360b8d2 100644
--- a/string.c
+++ b/string.c
@@ -2175,7 +2175,7 @@ rb_str_modify_expand(VALUE str, long expand)
if (expand < 0) {
rb_raise(rb_eArgError, "negative expanding string size");
}
- if (expand > LONG_MAX - len) {
+ if (expand >= LONG_MAX - len) {
rb_raise(rb_eArgError, "string size too big");
}