From 14d85c44c19d2f2b515928395ddb44714dc50a61 Mon Sep 17 00:00:00 2001 From: victor Date: Sun, 2 Nov 2003 16:23:33 +0000 Subject: fix logical error, check the existence before inc goodpost git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1290 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index e689c4ff..07fa4022 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1588,8 +1588,11 @@ recommend(int ent, fileheader_t * fhdr, char *direct) do_add_recommend(direct, fhdr, ent, buf); #ifdef ASSESS /* 每 10 次推文 加一次 goodpost */ - if ((fhdr->filemode & FILE_MARKED) && fhdr->recommend % 10 == 0) - inc_goodpost(searchuser(fhdr->owner), 1); + if ((fhdr->filemode & FILE_MARKED) && fhdr->recommend % 10 == 0) { + int uid = searchuser(fhdr->owner); + if (uid > 0) + inc_goodpost(uid, 1); + } #endif lastrecommend = now; return FULLUPDATE; @@ -1614,7 +1617,7 @@ mark_post(int ent, fileheader_t * fhdr, char *direct) #ifdef ASSESS if (!(fhdr->filemode & FILE_BID)){ if (fhdr->filemode & FILE_MARKED) { - if(!(currbrdattr&BRD_BAD)) + if (!(currbrdattr & BRD_BAD)) inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10); } else @@ -1750,7 +1753,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) cancelpost(fhdr, not_owned, newpath); #ifdef ASSESS num = searchuser(fhdr->owner); - if (not_owned && num > 0 && currmode & MODE_DIGEST) { + if (not_owned && num > 0 && !(currmode & MODE_DIGEST)) { getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO); if(genbuf[0]=='y') { if (!(inc_badpost(num, 1) % 10)){ -- cgit v1.2.3