summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-03-17 20:34:15 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-03-17 20:34:15 +0800
commit39b097d8003fafc8895952187e6216be3f9db4ca (patch)
tree4997948a3e744b42832a7293102d5b299a9f9bee
parent066e82d438feb56b585521dece4c03089aa53f0f (diff)
downloadpttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.tar
pttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.tar.gz
pttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.tar.bz2
pttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.tar.lz
pttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.tar.xz
pttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.tar.zst
pttbbs-39b097d8003fafc8895952187e6216be3f9db4ca.zip
rm unusable variable
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@699 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/voteboard.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c
index d1696547..18ee5854 100644
--- a/mbbsd/voteboard.c
+++ b/mbbsd/voteboard.c
@@ -1,4 +1,4 @@
-/* $Id: voteboard.c,v 1.15 2003/01/19 16:06:06 kcwu Exp $ */
+/* $Id: voteboard.c,v 1.16 2003/03/17 12:34:15 victor Exp $ */
#include "bbs.h"
#define VOTEBOARD "NewBoard"
@@ -12,7 +12,7 @@ do_voteboardreply(fileheader_t * fhdr)
char oldfpath[80];
char opnion[10];
char *ptr;
- FILE *fo, *fp;
+ FILE *fp;
fileheader_t votefile;
int len;
int i, j;
@@ -71,18 +71,18 @@ do_voteboardreply(fileheader_t * fhdr)
return;
flock(fd, LOCK_EX);
- fo = fopen(fpath, "w");
+ fp = fopen(fpath, "w");
- if (!fo)
+ if (!fp)
return;
i = 0;
- while (fo) {
+ while (fp) {
j = 0;
do {
if (read(fd, genbuf + j, 1) <= 0) {
flock(fd, LOCK_UN);
close(fd);
- fclose(fo);
+ fclose(fp);
unlink(fpath);
return;
}
@@ -94,20 +94,20 @@ do_voteboardreply(fileheader_t * fhdr)
break;
if (i > 3)
prints(genbuf);
- fprintf(fo, "%s", genbuf);
+ fprintf(fp, "%s", genbuf);
}
if (!hastime) {
now += 14 * 24 * 60 * 60;
- fprintf(fo, "連署結束時間: (%ld)%s", now, ctime(&now));
+ fprintf(fp, "連署結束時間: (%ld)%s", now, ctime(&now));
now -= 14 * 24 * 60 * 60;
}
- fprintf(fo, "%s", genbuf);
+ fprintf(fp, "%s", genbuf);
do {
if (!getdata(18, 0, "請問您 (Y)支持 (N)反對 這個議題:", opnion, 3, LCECHO)) {
flock(fd, LOCK_UN);
close(fd);
- fclose(fo);
+ fclose(fp);
unlink(fpath);
return;
}
@@ -117,20 +117,20 @@ do_voteboardreply(fileheader_t * fhdr)
reason, sizeof(reason), DOECHO)) {
flock(fd, LOCK_UN);
close(fd);
- fclose(fo);
+ fclose(fp);
unlink(fpath);
return;
}
i = 0;
- while (fo) {
+ while (fp) {
i++;
j = 0;
do {
if (read(fd, genbuf + j, 1) <= 0) {
flock(fd, LOCK_UN);
close(fd);
- fclose(fo);
+ fclose(fp);
unlink(fpath);
return;
}
@@ -140,15 +140,15 @@ do_voteboardreply(fileheader_t * fhdr)
if (!strncmp("----------", genbuf, 10))
break;
if (strncmp(genbuf + 4, cuser.userid, len))
- fprintf(fo, "%3d.%s", i, genbuf + 4);
+ fprintf(fp, "%3d.%s", i, genbuf + 4);
else
i--;
}
if (opnion[0] == 'y')
- fprintf(fo, "%3d.%-15s%-34s 來源:%s\n", i, cuser.userid, reason, cuser.lasthost);
+ fprintf(fp, "%3d.%-15s%-34s 來源:%s\n", i, cuser.userid, reason, cuser.lasthost);
i = 0;
- fprintf(fo, "%s", genbuf);
- while (fo) {
+ fprintf(fp, "%s", genbuf);
+ while (fp) {
i++;
j = 0;
do {
@@ -160,15 +160,15 @@ do_voteboardreply(fileheader_t * fhdr)
if (j <= 3)
break;
if (strncmp(genbuf + 4, cuser.userid, len))
- fprintf(fo, "%3d.%s", i, genbuf + 4);
+ fprintf(fp, "%3d.%s", i, genbuf + 4);
else
i--;
}
if (opnion[0] == 'n')
- fprintf(fo, "%3d.%-15s%-34s 來源:%s\n", i, cuser.userid, reason, cuser.lasthost);
+ fprintf(fp, "%3d.%-15s%-34s 來源:%s\n", i, cuser.userid, reason, cuser.lasthost);
flock(fd, LOCK_UN);
close(fd);
- fclose(fo);
+ fclose(fp);
unlink(oldfpath);
rename(fpath, oldfpath);
}