summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-02-20 11:01:39 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-02-20 11:01:39 +0800
commiteedb04eb15ca5970dc06a801a07dcf607ee87a7f (patch)
treed7b573af429c189b5b107064b20b426662636216
parenta6ac577334f79b99e5cffe8200874eb43979fe94 (diff)
downloadpttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.tar
pttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.tar.gz
pttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.tar.bz2
pttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.tar.lz
pttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.tar.xz
pttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.tar.zst
pttbbs-eedb04eb15ca5970dc06a801a07dcf607ee87a7f.zip
add help, fix typo
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1548 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/vote.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/mbbsd/vote.c b/mbbsd/vote.c
index cd2df5b4..4d652e0a 100644
--- a/mbbsd/vote.c
+++ b/mbbsd/vote.c
@@ -399,8 +399,8 @@ vote_view(char *bname, int vote_index)
boardheader_t *fhp;
FILE *fp;
char buf[STRLEN], genbuf[STRLEN], inbuf[STRLEN];
- short item_num;
- int num = 0, i, pos, *counts, total;
+ short item_num, i;
+ int num = 0, pos, *counts, total;
time_t closetime;
if (vote_index) {
@@ -440,8 +440,7 @@ vote_view(char *bname, int vote_index)
setbfile(genbuf, bname, STR_new_ballots);
convert_to_newversion(fp, buf, genbuf);
#endif
- fscanf(buf, "%hd,%hd", &item_num, &i);
- fscanf(fp, "%lu\n", &closetime);
+ fscanf(fp, "%hd,%hd\n%lu\n", &item_num, &i, &closetime);
counts = (int *)malloc(item_num * sizeof(int));
prints("\n』 箇щ布ㄆ: –程щ %d 布,ヘ玡Τ %d 布,\n"
@@ -580,8 +579,7 @@ vote_view_all(char *bname)
setbfile(buf, bname, STR_new_control);
- if ((fp = fopen(buf, "r"))) { // TODO try access()
- fclose(fp);
+ if (dashf(buf)) {
return vote_view(bname, atoi(genbuf));
} else
return FULLUPDATE;
@@ -900,13 +898,12 @@ user_vote_one(char *bname, int ind)
setbfile(inbuf, bname, STR_new_ballots);
convert_to_newversion(cfp, buf, inbuf);
#endif
- fscanf(cfp, "%hd,%hd", &item_num, &tickets);
+ fscanf(cfp, "%hd,%hd\n%lu\n", &item_num, &tickets, &closetime);
chosen = (char *)malloc(item_num);
memset(chosen, 0, item_num);
memset(choices, 0, sizeof(choices));
max_page = item_num / 30 + 1;
- fscanf(cfp, "%lu\n", &closetime);
prints("щ布よΑ絋﹚眤匡拒块ㄤ絏(A, B, C...)\n"
"Ωщ布щ %1hd 布 0 щ布, 1 ЧΘщ布, > , < \n"
"Ωщ布盢挡%s \n",