diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | string.c | 3 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Mon Sep 15 14:34:32 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * encoding.c (RUBY_MAX_CHAR_LEN): defined. + + * encoding.c (str_cat_char): use RUBY_MAX_CHAR_LEN. + Mon Sep 15 13:53:33 2008 NARUSE, Yui <naruse@ruby-lang.org> * encoding.c (rb_enc_compatible): accepst other than strings and @@ -43,6 +43,7 @@ VALUE rb_cString; VALUE rb_cSymbol; +#define RUBY_MAX_CHAR_LEN 16 #define STR_TMPLOCK FL_USER7 #define STR_NOEMBED FL_USER1 #define STR_SHARED FL_USER2 /* = ELTS_SHARED */ @@ -3790,7 +3791,7 @@ rb_str_to_s(VALUE str) static void str_cat_char(VALUE str, int c, rb_encoding *enc) { - char s[16]; + char s[RUBY_MAX_CHAR_LEN]; int n = rb_enc_codelen(c, enc); rb_enc_mbcput(c, s, enc); |