summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-29 22:33:07 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-29 22:33:07 +0800
commitec3a8a48e489eec1278ad8026139d9c405e069d6 (patch)
tree14da4db8ef505cf9e8306370244dba3d38c15f19 /mbbsd
parent6deb8c095903d745226ea2a6935d41f8cd0bb499 (diff)
downloadpttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.tar
pttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.tar.gz
pttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.tar.bz2
pttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.tar.lz
pttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.tar.xz
pttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.tar.zst
pttbbs-ec3a8a48e489eec1278ad8026139d9c405e069d6.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@71 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/vote.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/mbbsd/vote.c b/mbbsd/vote.c
index 8835a483..4e2df984 100644
--- a/mbbsd/vote.c
+++ b/mbbsd/vote.c
@@ -1,4 +1,4 @@
-/* $Id: vote.c,v 1.3 2002/03/29 13:45:28 ptt Exp $ */
+/* $Id: vote.c,v 1.4 2002/03/29 14:33:07 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -39,13 +39,13 @@ static char STR_bv_title[] = "vtitle";
static char STR_bv_results[] = "results";
-static char STR_new_control[] = "control0"; /* щ布ら戳 匡兜 */
-static char STR_new_desc[] = "desc0"; /* щ布ヘ */
-static char STR_new_ballots[] = "ballots0";
-static char STR_new_flags[] = "flags0";
-static char STR_new_comments[] = "comments0"; /* щ布種 */
-static char STR_new_limited[] = "limited0"; /* ╬щ布 */
-static char STR_new_title[] = "vtitle0";
+static char STR_new_control[] = "control0\0"; /* щ布ら戳 匡兜 */
+static char STR_new_desc[] = "desc0\0"; /* щ布ヘ */
+static char STR_new_ballots[] = "ballots0\0";
+static char STR_new_flags[] = "flags0\0";
+static char STR_new_comments[] = "comments0\0"; /* щ布種 */
+static char STR_new_limited[] = "limited0\0"; /* ╬щ布 */
+static char STR_new_title[] = "vtitle0\0";
int strip_ansi(char *buf, char *str, int mode) {
register int ansi, count = 0;
@@ -145,9 +145,6 @@ static void vote_report(char *bname, char *fname, char *fpath) {
}
close(fd);
- log_usies("TESTfn", fname);
- log_usies("TESTfp", fpath);
-
unlink(fpath);
link(fname, fpath);
@@ -536,11 +533,11 @@ static int vote_view_all(char *bname) {
getdata(b_lines - 1, 0, buf, genbuf, 4, LCECHO);
- if(genbuf[0] < '0' || genbuf[0] > '8')
- genbuf[0] = '0'+x;
+ if(atoi(genbuf) < 0 || atoi(genbuf) > 20)
+ sprintf(genbuf,"%d",x);
if(genbuf[0] != '0')
- sprintf(STR_new_control, "%s%c", STR_bv_control, genbuf[0]);
+ sprintf(STR_new_control, "%s%d", STR_bv_control, atoi(genbuf));
else
strcpy(STR_new_control, STR_bv_control);
@@ -548,7 +545,7 @@ static int vote_view_all(char *bname) {
if((fp=fopen(buf,"r"))) {
fclose(fp);
- return vote_view(bname, genbuf[0] - '0');
+ return vote_view(bname, atoi(genbuf));
}
else
return FULLUPDATE;
@@ -619,7 +616,7 @@ static int vote_maintain(char *bname) {
outs(err_board_update);
return FULLUPDATE;
- } else if(genbuf[0] != 'm' || fhp->bvote > 10)
+ } else if(genbuf[0] != 'm' || fhp->bvote >= 20)
return FULLUPDATE;
}
@@ -1028,11 +1025,11 @@ static int user_vote(char *bname) {
getdata(b_lines - 1, 0, buf, genbuf, 4, LCECHO);
- if(genbuf[0] < '0' || genbuf[0] > '8')
- genbuf[0] = x + '0';
+ if(atoi(genbuf) < 0 || atoi(genbuf) > 20)
+ sprintf(genbuf,"%d",x);
if(genbuf[0] != '0')
- sprintf(STR_new_control, "%s%c", STR_bv_control, genbuf[0]);
+ sprintf(STR_new_control, "%s%d", STR_bv_control, atoi(genbuf));
else
strcpy(STR_new_control, STR_bv_control);
@@ -1041,7 +1038,7 @@ static int user_vote(char *bname) {
if((fp = fopen(buf, "r"))){
fclose(fp);
- return user_vote_one(bname, genbuf[0] - '0');
+ return user_vote_one(bname, atoi(genbuf));
} else
return FULLUPDATE;
}