Permalink
Browse files

Do nothing when empty string

Fix #3361
  • Loading branch information...
ksss committed Dec 23, 2016
1 parent 5e3077c commit 0de65a88d44c108ec5035be2741bed486ad88de5
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/string.c
View
@@ -754,6 +754,9 @@ mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other)
other = mrb_str_to_str(mrb, other);
}
s2 = mrb_str_ptr(other);
if (RSTR_LEN(s2) == 0) {
return;
}
len = RSTR_LEN(s1) + RSTR_LEN(s2);
if (RSTRING_CAPA(self) < len) {

0 comments on commit 0de65a8

Please sign in to comment.