summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 3d6a36c5..66418259 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -6,13 +6,21 @@
#define OBUFSIZE 3072
#define IBUFSIZE 128
+/* realXbuf is Xbuf+3 because hz convert library requires buf[-2]. */
+#define CVTGAP (3)
+
#ifdef DEBUG
#define register
#endif
-/* realXbuf is Xbuf+3 because hz convert library requires buf[-2]. */
-static unsigned char real_outbuf[OBUFSIZE+6] = " ", real_inbuf[IBUFSIZE+6] = " ";
-static unsigned char *outbuf = real_outbuf + 3, *inbuf = real_inbuf + 3;
+static unsigned char real_outbuf[OBUFSIZE + CVTGAP*2] = " ",
+ real_inbuf [IBUFSIZE + CVTGAP*2] = " ";
+
+// use defines instead - it is discovered that sometimes the input/output buffer was overflow,
+// without knowing why.
+// static unsigned char *outbuf = real_outbuf + 3, *inbuf = real_inbuf + 3;
+#define inbuf (real_inbuf +CVTGAP)
+#define outbuf (real_outbuf+CVTGAP)
static int obufsize = 0, ibufsize = 0;
static int icurrchar = 0;