summaryrefslogtreecommitdiffstats
path: root/mbbsd/assess.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-27 09:48:17 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-27 09:48:17 +0800
commit21a627d65d7d0cabc6acc169ec35011ab51feab3 (patch)
tree72a2acc2d1423b10d5e9add3d4e0ca2ba96ceca4 /mbbsd/assess.c
parent95c901b5e0ce59134b89bcc31dc52043e0bdafc3 (diff)
downloadpttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.tar
pttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.tar.gz
pttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.tar.bz2
pttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.tar.lz
pttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.tar.xz
pttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.tar.zst
pttbbs-21a627d65d7d0cabc6acc169ec35011ab51feab3.zip
fix last commit bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1265 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/assess.c')
-rw-r--r--mbbsd/assess.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/mbbsd/assess.c b/mbbsd/assess.c
index 059fc078..46a1a6f9 100644
--- a/mbbsd/assess.c
+++ b/mbbsd/assess.c
@@ -4,18 +4,12 @@
/* do (*num) + n, n is integer. */
inline static void inc(unsigned char *num, int n)
{
- if (n > 0){
- if (SALE_MAXVALUE - *num < n)
- (*num) = SALE_MAXVALUE;
- else
- (*num) += n;
- }
- else {
- if (*num < n)
- (*num) = 0;
- else
- (*num) -= n;
- }
+ if (n >= 0 && SALE_MAXVALUE - *num < n)
+ (*num) = SALE_MAXVALUE;
+ else if (n < 0 && *num < -n)
+ (*num) = 0;
+ else
+ (*num) += n;
}
void inc_goodpost(int uid, int num)