diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-04-28 00:45:33 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-04-28 00:45:33 +0900 |
| commit | fdd4920ffdf098fd245079d6c0a881c42b776971 (patch) | |
| tree | e8be67f3d37983025774bd25bd8bd4dbe366d481 /src | |
| parent | 21a23c07f04433504faa93a4cdcad87f7c92c062 (diff) | |
| download | mruby-fdd4920ffdf098fd245079d6c0a881c42b776971.tar.gz mruby-fdd4920ffdf098fd245079d6c0a881c42b776971.zip | |
accessing out of region; fix #68
Diffstat (limited to 'src')
| -rw-r--r-- | src/string.c | 27 |
1 files changed, 0 insertions, 27 deletions
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 |
