diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-04-21 22:00:17 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-04-21 22:00:17 +0800 |
commit | 983e313a88264ac293d5502dc4631fa055996d02 (patch) | |
tree | dba6b7d14c6e2c5913b1ea86e112530aef24ca0c | |
parent | a0659057e0ce1b047b92413c28876a69ca984a46 (diff) | |
download | pttbbs-983e313a88264ac293d5502dc4631fa055996d02.tar pttbbs-983e313a88264ac293d5502dc4631fa055996d02.tar.gz pttbbs-983e313a88264ac293d5502dc4631fa055996d02.tar.bz2 pttbbs-983e313a88264ac293d5502dc4631fa055996d02.tar.lz pttbbs-983e313a88264ac293d5502dc4631fa055996d02.tar.xz pttbbs-983e313a88264ac293d5502dc4631fa055996d02.tar.zst pttbbs-983e313a88264ac293d5502dc4631fa055996d02.zip |
do not allow removing a NULL entry
reduce branch number
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2709 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/board.c | 16 | ||||
-rw-r--r-- | mbbsd/fav.c | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 78bbd92b..ed6274a8 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -582,6 +582,14 @@ show_brdlist(int head, int clsflag, int newflag) if (B_BH(ptr)->brdattr & BRD_BAD) #endif outs(" X "); + + else if (B_BH(ptr)->nuser <= 0) + prints(" %c ", B_BH(ptr)->bvote ? 'V' : ' '); + else if (B_BH(ptr)->nuser <= 10) + prints("%2d ", B_BH(ptr)->nuser); + else if (B_BH(ptr)->nuser <= 50) + prints("\033[1;33m%2d\033[m ", B_BH(ptr)->nuser); + else if (B_BH(ptr)->nuser >= 5000) outs("\033[1;34mĂz!\033[m"); else if (B_BH(ptr)->nuser >= 2000) @@ -590,14 +598,8 @@ show_brdlist(int head, int clsflag, int newflag) outs("\033[1mĂz!\033[m"); else if (B_BH(ptr)->nuser >= 100) outs("\033[1mHOT\033[m"); - else if (B_BH(ptr)->nuser > 50) + else //if (B_BH(ptr)->nuser > 50) prints("\033[1;31m%2d\033[m ", B_BH(ptr)->nuser); - else if (B_BH(ptr)->nuser > 10) - prints("\033[1;33m%2d\033[m ", B_BH(ptr)->nuser); - else if (B_BH(ptr)->nuser > 0) - prints("%2d ", B_BH(ptr)->nuser); - else - prints(" %c ", B_BH(ptr)->bvote ? 'V' : ' '); prints("%.*s\033[K", t_columns - 67, B_BH(ptr)->BM); } else { prints("%-40.40s %.*s", B_BH(ptr)->title + 7, diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 306f8d45..d106828e 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -588,6 +588,8 @@ static inline void fav_free_item(fav_type_t *ft) */ static int fav_remove(fav_t *fp, fav_type_t *ft) { + if (fp == NULL || ft == NULL) + return -1; fav_free_item(ft); fav_decrease(fp, ft); return 0; |