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/user.c | |
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/user.c')
-rw-r--r-- | mbbsd/user.c | 7 |
1 files changed, 4 insertions, 3 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 ? "£¾" : "¢æ")); + in = i; clrtobot(); while ((i = getkey("½Ð«ö [A-N] ¤Á´«³]©w¡A«ö [Return] µ²§ô¡G"))!='\r') { i = i - 'a'; - if (i >= NUMVIEWFILE || i < 0) + if (i >= in || i < 0) bell(); else { pbits ^= (1 << i); |