diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-06-19 01:14:32 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-06-19 01:14:32 +0800 |
commit | f5649a5aed5a9fc3b31b7964087252525fca5e60 (patch) | |
tree | b9ed59307e2eda718c057f1aa0ce016619b44f1d /mbbsd/chc.c | |
parent | 2edb2692f086fee13c46311bfcdab4eae847447c (diff) | |
download | pttbbs-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/chc.c')
-rw-r--r-- | mbbsd/chc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c index a4d3eeeb..82087703 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -949,11 +949,12 @@ chc_replay(FILE* fp) /* /\[(Red|Black) "([a-zA-Z0-9]+)"\]/; $2 */ userec_t rec; char *userid; + char *strtok_pos; ChessUser *user = (buf[1] == 'R' ? &info->user1 : &info->user2); - strtok(buf, "\""); - userid = strtok(NULL, "\""); + strtok_r(buf, "\"", &strtok_pos); + userid = strtok_r(NULL, "\"", &strtok_pos); if (userid != NULL && getuser(userid, &rec)) chc_init_user_userec(&rec, user); } |