diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-06 09:44:37 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-06 09:44:37 +0800 |
commit | 7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7 (patch) | |
tree | efac47cbab210834935fa5676f042f7c4f7248ed | |
parent | e2c742c761b51c1155b41b62832651ddd97c15e3 (diff) | |
download | pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.tar pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.tar.gz pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.tar.bz2 pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.tar.lz pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.tar.xz pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.tar.zst pttbbs-7ac02f0555ec1f6cf59c9bdc5fab42e90250e1b7.zip |
Fix segv: #1FVS--wT (PttBug) [ptt2.cc]
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5598 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/friend.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pttbbs/mbbsd/friend.c b/pttbbs/mbbsd/friend.c index 5b7992b2..8cf2eca2 100644 --- a/pttbbs/mbbsd/friend.c +++ b/pttbbs/mbbsd/friend.c @@ -139,6 +139,8 @@ friend_append(int type, int count) move(2, 0); clrtobot(); outs("要引入哪一個名單?\n"); + + // TODO make the selection algorithm better here. for (j = i = 0; i < 4; i++) if (i != type) { ++j; @@ -178,6 +180,8 @@ friend_append(int type, int count) if (j == FRIEND_SPECIAL) friend_special(); + if (!friend_file[j]) + return; setfriendfile(sfile, j); if ((fp = fopen(sfile, "r")) != NULL) { |