diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-24 22:06:48 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-24 22:06:48 +0800 |
commit | 9084d9602e8725a6fb832d4396c12ddd7bb2b7c7 (patch) | |
tree | 78d04dab42a50e73845c8e31eb877001fb8379cd /mbbsd/voteboard.c | |
parent | f6324fdcb56a70815842cc39cb1826ce6b82148c (diff) | |
download | pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.gz pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.bz2 pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.lz pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.xz pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.zst pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.zip |
use time4_t(uint32_t) instead of time_t for x86-64 arch.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2426 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/voteboard.c')
-rw-r--r-- | mbbsd/voteboard.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 8fba9b9e..21dcc721 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -15,7 +15,7 @@ do_voteboardreply(fileheader_t * fhdr) fileheader_t votefile; int yes=0, no=0, len; int fd; - time_t endtime=0; + time4_t endtime=0; clear(); @@ -55,7 +55,7 @@ do_voteboardreply(fileheader_t * fhdr) if (!strncmp(genbuf, "連署結束時間", 12)) { ptr = strchr(genbuf, '('); assert(ptr); - sscanf(ptr + 1, "%ld", &endtime); + sscanf(ptr + 1, "%d", &endtime); if (endtime < now) { vmsg("連署時間已過"); fclose(fi); @@ -110,7 +110,7 @@ do_voteboardreply(fileheader_t * fhdr) } if (!endtime) { now += 14 * 24 * 60 * 60; - fprintf(fo, "連署結束時間: (%ld)%s", now, ctime(&now)); + fprintf(fo, "連署結束時間: (%d)%s\n", now, Cdate(&now)); now -= 14 * 24 * 60 * 60; } fputs(genbuf, fo); @@ -319,9 +319,10 @@ do_voteboard(int type) return FULLUPDATE; strcat(genbuf, "連署結束時間: "); now += 14 * 24 * 60 * 60; - snprintf(topic, sizeof(topic), "(%ld)", now); + snprintf(topic, sizeof(topic), "(%d)", now); strcat(genbuf, topic); - strcat(genbuf, ctime(&now)); + strcat(genbuf, Cdate(&now)); + strcat(genbuf, "\n"); now -= 14 * 24 * 60 * 60; strcat(genbuf, "----------支持----------\n"); strcat(genbuf, "----------反對----------\n"); @@ -333,10 +334,10 @@ do_voteboard(int type) outs("開檔失敗,請稍候重來一次"); return FULLUPDATE; } - fprintf(fp, "%s%s %s%s\n%s%s\n%s%s", "作者: ", cuser.userid, + fprintf(fp, "%s%s %s%s\n%s%s\n%s%s\n", "作者: ", cuser.userid, "看板: ", currboard, "標題: ", title, - "時間: ", ctime(&now)); + "時間: ", Cdate(&now)); fprintf(fp, "%s\n", genbuf); fclose(fp); strlcpy(votefile.owner, cuser.userid, sizeof(votefile.owner)); |