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
commite8b48976c41bd051144b7ede4462060ecf3aebaf (patch)
tree5681c2f02ea1a105da3f815c6a0cdd2c5270aa0f
parentfdd6a6f65cd6eebfc16b8b4cb3d76df316482597 (diff)
downloadpttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.tar
pttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.tar.gz
pttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.tar.bz2
pttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.tar.lz
pttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.tar.xz
pttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.tar.zst
pttbbs-e8b48976c41bd051144b7ede4462060ecf3aebaf.zip
fix logical error, check the existence before inc goodpost
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1290 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index e689c4ff..07fa4022 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/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)){