From: handa Date: Thu, 7 Sep 2006 07:56:47 +0000 (+0000) Subject: (mtext_cat_char): Allocate more memory. X-Git-Tag: REL-1-3-4~77 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20932fc9ba3b7f843e6b363a3c0f0b1e7eba1996;p=m17n%2Fm17n-lib.git (mtext_cat_char): Allocate more memory. (mdebug_dump_mtext): Don't escal a newline character. --- diff --git a/src/mtext.c b/src/mtext.c index 1387f3c..1dd8d57 100644 --- a/src/mtext.c +++ b/src/mtext.c @@ -2023,7 +2023,7 @@ mtext_cat_char (MText *mt, int c) nunits = CHAR_UNITS (c, mt->format); if ((mt->nbytes + nunits + 1) * unit_bytes > mt->allocated) { - mt->allocated = (mt->nbytes + nunits + 1) * unit_bytes; + mt->allocated = (mt->nbytes + nunits * 16 + 1) * unit_bytes; MTABLE_REALLOC (mt->data, mt->allocated, MERROR_MTEXT); } @@ -3607,7 +3607,7 @@ mdebug_dump_mtext (MText *mt, int indent, int fullp) if (c == '"' || c == '\\') fprintf (stderr, "\\%c", c); - else if (c >= ' ' && c < 127) + else if ((c >= ' ' && c < 127) || c == '\n') fprintf (stderr, "%c", c); else fprintf (stderr, "\\x%02X", c);