diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-05 11:50:54 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-05 11:50:54 +0800 |
commit | 78bb6105f51ab157263d3eddb00801cef00c8292 (patch) | |
tree | 1da3dc5bfb1133b135636e860771f72512e3d231 /mbbsd/friend.c | |
parent | 5ff654dfae96beac71fbbebf9fed577e5f83d3a3 (diff) | |
download | pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.tar pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.tar.gz pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.tar.bz2 pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.tar.lz pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.tar.xz pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.tar.zst pttbbs-78bb6105f51ab157263d3eddb00801cef00c8292.zip |
- fix friend description length on screen
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4082 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/friend.c')
-rw-r--r-- | mbbsd/friend.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 4ec98f9a..db36a8cc 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -74,15 +74,18 @@ friend_add(const char *uident, int type, const char* des) if ((uident[0] > ' ') && !belong(fpath, uident)) { char buf[STRLEN] = "", buf2[256]; char t_uident[IDLEN + 1]; + const maxdesclen = 40; // + + assert(maxdesclen <= sizeof(buf)); /* Thor: avoid uident run away when get data */ strlcpy(t_uident, uident, sizeof(t_uident)); if (type != FRIEND_ALOHA && type != FRIEND_POST){ if(!des) - getdata(2, 0, friend_desc[type], buf, sizeof(buf), DOECHO); + getdata(2, 0, friend_desc[type], buf, maxdesclen, DOECHO); else - getdata_str(2, 0, friend_desc[type], buf, sizeof(buf), DOECHO, des); + getdata_str(2, 0, friend_desc[type], buf, maxdesclen, DOECHO, des); } snprintf(buf2, sizeof(buf2), "%-13s%s\n", t_uident, buf); |