From 34953aa4ec4100d0bfc840c99cc91f5e30ba0252 Mon Sep 17 00:00:00 2001 From: kcwu Date: Sat, 8 Apr 2006 14:21:40 +0000 Subject: bug fix: vote status not refresh properly and write value out of board array git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3334 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/vote.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 8c4070e6..e12d72f0 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -413,7 +413,7 @@ static int b_closepolls(void) { boardheader_t *fhp; - int pos, dirty; + int pos; vote_buffer_t vbuf; #ifndef BARRIER_HAS_BEEN_IN_SHM @@ -435,16 +435,14 @@ b_closepolls(void) fclose(cfp); #endif - dirty = 0; for (fhp = bcache, pos = 1; pos <= numboards; fhp++, pos++) { if (fhp->bvote && b_close(fhp, &vbuf)) { if (substitute_record(fn_board, fhp, sizeof(*fhp), pos) == -1) outs(err_board_update); - dirty = 1; + else + reset_board(pos); } } - if (dirty) /* vote flag changed */ - reset_board(pos); return 0; } -- cgit v1.2.3