summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-08-27 14:13:06 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-08-27 14:13:06 +0800
commit34ccab684503c753fdfaf7caa56dd9f2c8415589 (patch)
tree5e51897b8298696d0658fed61926740d3abec8a0
parente7130cce084e10e93494b6695245b71acb1c1160 (diff)
downloadpttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.tar
pttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.tar.gz
pttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.tar.bz2
pttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.tar.lz
pttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.tar.xz
pttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.tar.zst
pttbbs-34ccab684503c753fdfaf7caa56dd9f2c8415589.zip
fix bug in r2169
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2168 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/io.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 1840162d..75d38c96 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -290,15 +290,18 @@ igetch()
if (currutmp->msgs[0].pid &&
WATERMODE(WATER_OFO) && wmofo == NOTREPLYING) {
int y, x, my_newfd;
- screenline_t *screen0 = calloc(WB_OFO_WINDOW_HEIGHT, sizeof(screenline_t));
- memcpy(screen0, &big_picture[WB_OFO_USER_TOP - 1],
- WB_OFO_WINDOW_HEIGHT * sizeof(screenline_t));
+ screenline_t *screen0 = calloc(WB_OFO_WINDOW_HEIGHT + 1,
+ sizeof(screenline_t));
+ memcpy(&screen0[0], &big_picture[0], sizeof(screenline_t));
+ memcpy(&screen0[1], &big_picture[WB_OFO_USER_TOP],
+ WB_OFO_WINDOW_HEIGHT * sizeof(screenline_t));
getyx(&y, &x);
my_newfd = i_newfd;
i_newfd = 0;
my_write2();
- memcpy(&big_picture[WB_OFO_USER_TOP - 1], screen0,
- WB_OFO_WINDOW_HEIGHT * sizeof(screenline_t));
+ memcpy(&big_picture[0], &screen0[0], sizeof(screenline_t));
+ memcpy(&big_picture[WB_OFO_USER_TOP], &screen0[1],
+ WB_OFO_WINDOW_HEIGHT * sizeof(screenline_t));
i_newfd = my_newfd;
move(y, x);
free(screen0);