From 20932fc9ba3b7f843e6b363a3c0f0b1e7eba1996 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 7 Sep 2006 07:56:47 +0000 Subject: [PATCH] (mtext_cat_char): Allocate more memory. (mdebug_dump_mtext): Don't escal a newline character. --- src/mtext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 1.7.10.4