diff options
Diffstat (limited to 'mbbsd/voteboard.c')
-rw-r--r-- | mbbsd/voteboard.c | 4 |
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("您已經連署過本篇了"); |