summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-18 16:45:22 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-18 16:45:22 +0800
commitdd77a6fade313baec6f08d0756498e47a0fb2a88 (patch)
tree309d41f98bd9e0c2415d9b92b180d98cb9eee0c9
parente9e696834a6f7a665e9c6af7794620a716e34b4d (diff)
downloadpttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.tar
pttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.tar.gz
pttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.tar.bz2
pttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.tar.lz
pttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.tar.xz
pttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.tar.zst
pttbbs-dd77a6fade313baec6f08d0756498e47a0fb2a88.zip
fix bug SIGSEV when only 1 user online
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1781 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 14d5d0d2..2517ee1e 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -417,7 +417,8 @@ count_logins(int uid, int show)
j = uid - ulist[i]->uid;
if (!j) {
for (; i > 0 && uid == ulist[i - 1]->uid; i--); /* 指到第一筆 */
- for (count = 0; uid == ulist[i + count]->uid; count++) {
+ for (count = 0; (ulist[i + count] &&
+ uid == ulist[i + count]->uid); count++) {
if (show)
prints("(%d) 目前狀態為: %-17.16s(來自 %s)\n",
count + 1, modestring(ulist[i + count], 0),