summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--string.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 89492428ac..2da3db02d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/string.c b/string.c
index dd61d52da7..843d770cd0 100644
--- a/string.c
+++ b/string.c
@@ -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);