From fdd4920ffdf098fd245079d6c0a881c42b776971 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Sat, 28 Apr 2012 00:45:33 +0900 Subject: accessing out of region; fix #68 --- src/string.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 0ba97f851..45f2a8842 100644 --- a/src/string.c +++ b/src/string.c @@ -4740,35 +4740,8 @@ mrb_lastline_set(mrb_value val) mrb_value mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2) { -#ifdef INCLUDE_ENCODING - mrb_encoding *enc; - int cr, cr2; -#endif //INCLUDE_ENCODING - - //StringValue(str2); mrb_string_value(mrb, &str2); - if (RSTRING_LEN(str2) > 0 /*&& STR_ASSOC_P(str)*/) { - long len = RSTRING_LEN(str)+RSTRING_LEN(str2); -#ifdef INCLUDE_ENCODING - enc = mrb_enc_check(mrb, str, str2); - cr = ENC_CODERANGE(str); - if ((cr2 = ENC_CODERANGE(str2)) > cr) cr = cr2; -#endif //INCLUDE_ENCODING - mrb_str_modify(mrb, str); - REALLOC_N(mrb, RSTRING(str)->buf, char, len+1); - memcpy(RSTRING(str)->buf + RSTRING(str)->len, - RSTRING_PTR(str2), RSTRING_LEN(str2)+1); - RSTRING(str)->len = len; - mrb_enc_associate(mrb, str, enc); - ENC_CODERANGE_SET(str, cr); - - return str; - } -#ifdef INCLUDE_ENCODING return mrb_str_buf_append(mrb, str, str2); -#else - return str; -#endif //INCLUDE_ENCODING } void -- cgit v1.2.3