diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-16 23:30:02 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-16 23:30:02 +0800 |
commit | 5f1b1f41ba2043cc6c744d7acc877396f525e296 (patch) | |
tree | c443b67f5debe738ab0727b9ec1edf952c58444a /mbbsd | |
parent | 5b8ae2c4d6f73e6c762534586f8e86a0bc54de2b (diff) | |
download | pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.tar pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.tar.gz pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.tar.bz2 pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.tar.lz pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.tar.xz pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.tar.zst pttbbs-5f1b1f41ba2043cc6c744d7acc877396f525e296.zip |
- var/user: prevent printing NULL for login view conf
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3839 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/user.c | 7 | ||||
-rw-r--r-- | mbbsd/var.c | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c index b2a37e2d..f24c2f13 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -40,20 +40,21 @@ kill_user(int num, const char *userid) int u_loginview(void) { - int i; + int i, in; unsigned int pbits = cuser.loginview; clear(); move(4, 0); - for (i = 0; i < NUMVIEWFILE; i++) + for (i = 0; i < NUMVIEWFILE && loginview_file[i][0]; i++) prints(" %c. %-20s %-15s \n", 'A' + i, loginview_file[i][1], ((pbits >> i) & 1 ? "ˇ" : "X")); + in = i; clrtobot(); while ((i = getkey("請按 [A-N] 切換設定,按 [Return] 結束:"))!='\r') { i = i - 'a'; - if (i >= NUMVIEWFILE || i < 0) + if (i >= in || i < 0) bell(); else { pbits ^= (1 << i); diff --git a/mbbsd/var.c b/mbbsd/var.c index 00a0190f..4023c019 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -142,7 +142,8 @@ char * const loginview_file[NUMVIEWFILE][2] = { {"etc/yesterday", "昨日上站人次"}, {"etc/history", "歷史上的今天"}, {"etc/topboardman", "精華區排行榜"}, - {"etc/topboard.tmp", "看板人氣排行榜"} + {"etc/topboard.tmp", "看板人氣排行榜"}, + {NULL, NULL} }; /* message */ |