diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-10 15:18:17 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-10 15:18:17 +0800 |
commit | a7fa433bcdcce4a14154ac0f010e656867b90f41 (patch) | |
tree | ddf57b40bff67a003961a60b90cda4fa72b2d5f1 /mbbsd/vote.c | |
parent | 7844305800a7a4781ac46777d429dbe667327911 (diff) | |
download | pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.tar pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.tar.gz pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.tar.bz2 pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.tar.lz pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.tar.xz pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.tar.zst pttbbs-a7fa433bcdcce4a14154ac0f010e656867b90f41.zip |
fix for compile
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2056 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/vote.c')
-rw-r--r-- | mbbsd/vote.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 0338427b..e08431ae 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -38,7 +38,7 @@ convert_to_newversion(FILE *fp, char *file, char *ballots) if (index(buf, ',')) { rewind(fp); flock(fileno(fp), LOCK_UN); - return; + return fp; } sscanf(buf, " %d", &tmp); @@ -62,7 +62,7 @@ convert_to_newversion(FILE *fp, char *file, char *ballots) if (!(fpw = fopen(buf2, "w"))) { rewind(fp); flock(fileno(fp), LOCK_UN); - return; + return NULL; } fprintf(fpw, "000,000\n"); while (fgets(buf, sizeof(buf), fp)) { @@ -233,8 +233,9 @@ b_result_one(boardheader_t * fh, int ind, int *total) cfp = fopen(buf, "r"); #if 1 // backward compatible setbfile(b_control, bname, STR_new_ballots); - fp = convert_to_newversion(cfp, buf, b_control); + cfp = convert_to_newversion(cfp, buf, b_control); #endif + assert(cfp); fscanf(cfp, "%hd,%hd\n%lu\n", &item_num, &junk, &closetime); fclose(cfp); @@ -448,6 +449,7 @@ vote_view(char *bname, int vote_index) setbfile(genbuf, bname, STR_new_ballots); fp = convert_to_newversion(fp, buf, genbuf); #endif + assert(fp); fscanf(fp, "%hd,%hd\n%lu\n", &item_num, &i, &closetime); counts = (int *)malloc(item_num * sizeof(int)); @@ -897,8 +899,9 @@ user_vote_one(char *bname, int ind) #if 1 // backward compatible setbfile(buf, bname, STR_new_control); setbfile(inbuf, bname, STR_new_ballots); - fp = convert_to_newversion(cfp, buf, inbuf); + cfp = convert_to_newversion(cfp, buf, inbuf); #endif + assert(cfp); fscanf(cfp, "%hd,%hd\n%lu\n", &item_num, &tickets, &closetime); chosen = (char *)malloc(item_num); memset(chosen, 0, item_num); |