diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-10-01 22:42:57 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-10-01 22:42:57 +0800 |
commit | 233e3205df3f43bf54ed366333fc71340ca71bef (patch) | |
tree | e49249aa461450e97c8d469d640f6da164c8bb2e /mbbsd | |
parent | efd842401473002b70d43e50aa3ecffe1423a899 (diff) | |
download | pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.gz pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.bz2 pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.lz pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.xz pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.tar.zst pttbbs-233e3205df3f43bf54ed366333fc71340ca71bef.zip |
* eliminate warnings according to lxb's commit on pttbbslite
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3581 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 2 | ||||
-rw-r--r-- | mbbsd/chat.c | 43 | ||||
-rw-r--r-- | mbbsd/read.c | 5 | ||||
-rw-r--r-- | mbbsd/user.c | 2 | ||||
-rw-r--r-- | mbbsd/var.c | 1 | ||||
-rw-r--r-- | mbbsd/vote.c | 2 |
6 files changed, 6 insertions, 49 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 967657b0..38cabddd 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -581,7 +581,7 @@ deleteCrossPost(const fileheader_t *fh, char *bname) } void -delete_allpost(char *userid) +delete_allpost(const char *userid) { fileheader_t fhdr; int fd, i; diff --git a/mbbsd/chat.c b/mbbsd/chat.c index cb252e15..9d729969 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -116,37 +116,6 @@ chat_recv(struct ChatBuf *cb, int fd, char *chatroom, char *chatid, size_t chati return 0; } -static int -printuserent(const userinfo_t * uentp) -{ - static char uline[80]; - static int cnt; - char pline[30]; - - if (!uentp) { - if (cnt) - printchatline(uline); - bzero(uline, sizeof(uline)); - cnt = 0; - return 0; - } - if (!HasUserPerm(PERM_SYSOP) && !HasUserPerm(PERM_SEECLOAK) && uentp->invisible) - return 0; - - snprintf(pline, sizeof(pline), "%-13s%c%-10s ", uentp->userid, - uentp->invisible ? '#' : ' ', - modestring(uentp, 1)); - if (cnt < 2) - strlcat(pline, "│", sizeof(pline)); - strlcat(uline, pline, sizeof(uline)); - if (++cnt == 3) { - printchatline(uline); - memset(uline, 0, 80); - cnt = 0; - } - return 0; -} - static void chathelp(const char *cmd, const char *desc) { @@ -249,18 +218,6 @@ chat_query(char *arg) printchatline(err_uid); } -static void -chat_users(char* unused) -{ - printchatline(""); - printchatline("【 " BBSNAME "的遊客列表 】"); - printchatline(msg_shortulist); - - if (apply_ulist(printuserent) == -1) - printchatline("空無一人"); - printuserent(NULL); -} - typedef struct chat_command_t { char *cmdname; /* Chatroom command length */ void (*cmdfunc) (char *); /* Pointer to function */ diff --git a/mbbsd/read.c b/mbbsd/read.c index 7a3d0d4b..784db7c2 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -537,6 +537,7 @@ select_read(const keeploc_t * locmem, int sr_mode) } else { /* use cached data */ reload = 0; + inc = 0; } /* mark and recommend shouldn't incremental select */ @@ -616,9 +617,9 @@ select_read(const keeploc_t * locmem, int sr_mode) } } // end while close(fr); + ftruncate(fd, count*sizeof(fileheader_t)); + close(fd); } - ftruncate(fd, count*sizeof(fileheader_t)); - close(fd); } if(count) { diff --git a/mbbsd/user.c b/mbbsd/user.c index 4abc44ca..ed15a4e5 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -16,7 +16,7 @@ static const char * const chess_type[3] = { #endif int -kill_user(int num, char *userid) +kill_user(int num, const char *userid) { userec_t u; char src[256], dst[256]; diff --git a/mbbsd/var.c b/mbbsd/var.c index 39c87442..ecf91169 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -147,7 +147,6 @@ char * const loginview_file[NUMVIEWFILE][2] = { /* message */ char * const msg_seperator = MSG_SEPERATOR; -char * const msg_shortulist = MSG_SHORTULIST; char * const msg_cancel = MSG_CANCEL; char * const msg_usr_left = MSG_USR_LEFT; diff --git a/mbbsd/vote.c b/mbbsd/vote.c index d15ee08f..47d41bf7 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -1066,7 +1066,7 @@ user_vote_one(vote_buffer_t *vbuf, const char *bname, int ind) if (buf[0] == 'Q' || buf[0] == 'q') break; setbfile(b_comments, bname, vbuf->comments); - if (mycomments[0]) + if (mycomments[0][0]) if ((fcm = fopen(b_comments, "a"))) { fprintf(fcm, ANSI_COLOR(36) "○使用者" ANSI_COLOR(1;36) " %s " |