summaryrefslogtreecommitdiffstats
path: root/mbbsd/voteboard.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/voteboard.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/voteboard.c')
-rw-r--r--mbbsd/voteboard.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c
index c228abfb..0b644a60 100644
--- a/mbbsd/voteboard.c
+++ b/mbbsd/voteboard.c
@@ -44,6 +44,7 @@ do_voteboardreply(const fileheader_t * fhdr)
assert(fi);
while (fgets(genbuf, sizeof(genbuf), fi)) {
+ char *newline;
if (yes>=0)
{
@@ -66,7 +67,8 @@ do_voteboardreply(const fileheader_t * fhdr)
}
if(yes>=0) continue;
- strtok(genbuf+4," \n");
+ newline = strpbrk(genbuf+4, " \n");
+ if(newline) *newline='\0';
if (!strncmp(genbuf + 4, cuser.userid, IDLEN)) {
move(5, 10);
outs("您已經連署過本篇了");