From 21a627d65d7d0cabc6acc169ec35011ab51feab3 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 27 Oct 2003 01:48:17 +0000 Subject: fix last commit bug git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1265 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/assess.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'mbbsd') 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) -- cgit v1.2.3