From 6c3184cac09d7b7c21dde5f80d3a61385a4d3969 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 23 Apr 2017 13:33:09 +1000 Subject: [PATCH] make the buffers bigger --- doors.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doors.c b/doors.c index 627bd06..0da1b67 100644 --- a/doors.c +++ b/doors.c @@ -320,11 +320,11 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c ic = iconv_open(codepage, "UTF-8"); } ptr1 = outbuf; - ptr2 = (char *)malloc((g + 1) * 2); + ptr2 = (char *)malloc((g + 1) * 4); ptr2p = ptr2; - memset(ptr2, 0, (g + 1) * 2); + memset(ptr2, 0, (g + 1) * 4); inc = g; - ouc = (g + 1) * 2; + ouc = (g + 1) * 4; iconv(ic, &ptr1, &inc, &ptr2, &ouc); write(master, ptr2p, ptr2 - ptr2p); @@ -355,11 +355,11 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c ic = iconv_open("UTF-8", codepage); } ptr1 = outbuf; - ptr2 = (char *)malloc((g + 1) * 2); + ptr2 = (char *)malloc((g + 1) * 4); ptr2p = ptr2; - memset(ptr2, 0, (g + 1) * 2); + memset(ptr2, 0, (g + 1) * 4); inc = g; - ouc = (g + 1) * 2; + ouc = (g + 1) * 4; sz = iconv(ic, &ptr1, &inc, &ptr2, &ouc); if (sz == -1) {