summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-03 00:23:33 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-03 00:23:33 +0800
commit14d85c44c19d2f2b515928395ddb44714dc50a61 (patch)
tree23b1804cfe88aaa178f5fd60d5b0e631a45bfc98
parente587b2b5ca8b85091166868b9dfe44c973015104 (diff)
downloadpttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.tar
pttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.tar.gz
pttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.tar.bz2
pttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.tar.lz
pttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.tar.xz
pttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.tar.zst
pttbbs-14d85c44c19d2f2b515928395ddb44714dc50a61.zip
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
-rw-r--r--mbbsd/bbs.c11
1 files 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)){