From b02f3ea91b4e4831222759dd1dd4c137957766d5 Mon Sep 17 00:00:00 2001 From: wens Date: Tue, 23 Nov 2004 00:27:45 +0000 Subject: corrected comment and bitmask git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2351 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/voteboard.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mbbsd/voteboard.c') diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index c2e191a6..899885bd 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -16,21 +16,21 @@ do_votelimitedit(int ent, fileheader_t * fhdr, char *direct) return DONOTHING; getdata(23, 0, "更改 (A)本篇 (B)本版預設連署限制 (C)取消?[C]", genbuf, 3, LCECHO); if (genbuf[0] == 'a' || genbuf[0] == 'A') { - sprintf(genbuf, "%u", ((fhdr->money >> 8) & 0xF) * 10); + sprintf(genbuf, "%u", ((fhdr->money >> 8) & 0xFF) * 10); do { getdata_buf(23, 0, "上站次數下限 (0~2550):", genbuf, 5, LCECHO); temp = atoi(genbuf); } while (temp < 0 || temp > 2550); temp /= 10; - fhdr->money = (fhdr->money & ~(0xF0)) | (temp << 8); + fhdr->money = (fhdr->money & ~(0xFF00)) | (temp << 8); - sprintf(genbuf, "%u", (fhdr->money & 0xF) * 10); + sprintf(genbuf, "%u", (fhdr->money & 0xFF) * 10); do { getdata_buf(23, 0, "文章篇數下限 (0~2550):", genbuf, 5, LCECHO); temp = atoi(genbuf); } while (temp < 0 || temp > 2550); temp /= 10; - fhdr->money = (fhdr->money & ~(0xF)) | temp; + fhdr->money = (fhdr->money & ~(0xFF)) | temp; substitute_ref_record(direct, fhdr, ent); vmsg("修改完成!"); return FULLUPDATE; @@ -81,7 +81,7 @@ do_voteboardreply(fileheader_t * fhdr) return; } len = fhdr->money; - if ( cuser.numlogins < (((len >> 8) & 0xF) * 10) || cuser.numposts < ((len & 0xF) * 10) ) { + if ( cuser.numlogins < (((len >> 8) & 0xFF) * 10) || cuser.numposts < ((len & 0xFF) * 10) ) { move(5, 10); vmsg("你的上站數/文章數不足喔!"); return; @@ -394,7 +394,7 @@ do_voteboard(int type) votefile.filemode |= FILE_VOTE; temp = getbnum(currboard); /* use lower 16 bits of 'money' to store limits */ - /* lower 8 bits are logins, higher 8 bits are posts */ + /* lower 8 bits are posts, higher 8 bits are logins */ votefile.money = ( ((unsigned int)(bcache[temp - 1].limit_logins) << 8) | (unsigned int)(bcache[temp - 1].limit_posts) ); setbdir(genbuf, currboard); -- cgit v1.2.3