From ff7c042eac0c369013b8f1c505ccc06134ec440d Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 12 Oct 2011 01:50:11 +0000 Subject: fix: angels editing message will see #1 line truncated if it exceed maximum length git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5412 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/angel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c index 1720c799..b41c39dc 100644 --- a/pttbbs/mbbsd/angel.c +++ b/pttbbs/mbbsd/angel.c @@ -190,6 +190,7 @@ a_angelmsg(){ int i; FILE* fp; + move(1, 0); clrtobot(); setuserfile(buf, "angelmsg"); fp = fopen(buf, "r"); if (fp) { @@ -226,8 +227,9 @@ a_angelmsg(){ clrtobot(); outs("不在的時候要跟小主人說什麼呢?" "最多三行,按[Enter]結束"); + // the -1 is for newline and we use to fgets() to read later for (i = 0; i < 3 && - getdata_buf(14 + i, 0, ":", msg[i], sizeof(msg[i]), DOECHO); + getdata_buf(14 + i, 0, ":", msg[i], sizeof(msg[i])-1, DOECHO); ++i); getdata(b_lines - 2, 0, "(S)儲存 (E)重新來過 (Q)取消?[S]", buf, 4, LCECHO); -- cgit v1.2.3