From 955bf38c3b57fb2c3b1be5c9392beb7128668956 Mon Sep 17 00:00:00 2001 From: ptt Date: Sat, 6 Jan 2007 21:47:48 +0000 Subject: fix a bug. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3467 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/proto.h | 2 +- mbbsd/bbs.c | 5 +++-- mbbsd/user.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/proto.h b/include/proto.h index 28a4404f..5e237e20 100644 --- a/include/proto.h +++ b/include/proto.h @@ -716,7 +716,7 @@ void sortsong(void); int topsong(void); /* user */ -int kill_user(int num, const char *userid); +int kill_user(int num, char *userid); int u_editcalendar(void); void user_display(const userec_t *u, int real); void uinfo_query(userec_t *u, int real, int unum); diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 20b2327e..2c7f7f98 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -760,7 +760,7 @@ static int do_general(int isbid) { bid_t bidinfo; - fileheader_t postfile; + fileheader_t postfile, fh; char fpath[80], buf[80]; int aborted, defanony, ifuseanony, i; char genbuf[200], *owner; @@ -944,7 +944,8 @@ do_general(int isbid) } strcpy(genbuf, fpath); setbpath(fpath, currboard); - stampfile(fpath, &postfile); + stampfile(fpath, &fh); + strcpy(postfile.filename, fh.filename); // Ptt: stamp file again to make it order // fix the bug that search failure in getindex // diff --git a/mbbsd/user.c b/mbbsd/user.c index 3a3c396f..c0e55bda 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -16,11 +16,12 @@ static const char * const chess_type[3] = { #endif int -kill_user(int num, const char *userid) +kill_user(int num, char *userid) { userec_t u; char src[256], dst[256]; + if(!userid || num<=0 ) return -1; sethomepath(src, userid); snprintf(dst, sizeof(dst), "tmp/%s", userid); friend_delete_all(userid, FRIEND_ALOHA); -- cgit v1.2.3