diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-23 08:27:45 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-23 08:27:45 +0800 |
commit | b02f3ea91b4e4831222759dd1dd4c137957766d5 (patch) | |
tree | 38f167e3c3aa97b054fe54dc5fcbd0798bbf141d | |
parent | 95c641975bb6c7625a998135079c17e0844f5bbf (diff) | |
download | pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.tar pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.tar.gz pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.tar.bz2 pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.tar.lz pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.tar.xz pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.tar.zst pttbbs-b02f3ea91b4e4831222759dd1dd4c137957766d5.zip |
corrected comment and bitmask
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2351 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/voteboard.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); |