diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-10-12 09:50:11 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-10-12 09:50:11 +0800 |
commit | ff7c042eac0c369013b8f1c505ccc06134ec440d (patch) | |
tree | 213c451de1fc38f2c1bd99a6bb75bc4de8f448bd | |
parent | b6ffe5eb6f9762e8bcdd5311067368c30f3e6ebc (diff) | |
download | pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.tar pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.tar.gz pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.tar.bz2 pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.tar.lz pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.tar.xz pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.tar.zst pttbbs-ff7c042eac0c369013b8f1c505ccc06134ec440d.zip |
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
-rw-r--r-- | pttbbs/mbbsd/angel.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |