summaryrefslogtreecommitdiffstats
path: root/mbbsd/vote.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-06-19 01:14:32 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-06-19 01:14:32 +0800
commitf5649a5aed5a9fc3b31b7964087252525fca5e60 (patch)
treeb9ed59307e2eda718c057f1aa0ce016619b44f1d /mbbsd/vote.c
parent2edb2692f086fee13c46311bfcdab4eae847447c (diff)
downloadpttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.tar
pttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.tar.gz
pttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.tar.bz2
pttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.tar.lz
pttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.tar.xz
pttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.tar.zst
pttbbs-f5649a5aed5a9fc3b31b7964087252525fca5e60.zip
* use strtok_r() instead of strtok(). fix bad strtok() usages.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3545 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/vote.c')
-rw-r--r--mbbsd/vote.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/vote.c b/mbbsd/vote.c
index 5aa6fda6..917865e8 100644
--- a/mbbsd/vote.c
+++ b/mbbsd/vote.c
@@ -966,9 +966,11 @@ user_vote_one(vote_buffer_t *vbuf, const char *bname, int ind)
count = 0;
for (i = 0; i < ITEM_PER_PAGE && fgets(inbuf, sizeof(inbuf), cfp); i++) {
+ char *newline = strpbrk(inbuf, "\r\n");
+ if (newline) *newline = '\0';
move((count % 15) + 5, (count / 15) * 40);
prints("%c%s", chosen[curr_page * ITEM_PER_PAGE + i] ? '*' : ' ',
- strtok(inbuf, "\n\0"));
+ inbuf);
choices[count % ITEM_PER_PAGE] = inbuf[0];
count++;
}