summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-23 01:57:35 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-23 01:57:35 +0800
commitfd20564209c77de3975e708a5646731d76e62d92 (patch)
tree64c7be918015e40cb6405e905cd35d20550f4f62
parentf3345cd954974f80862940ec628f17942a288316 (diff)
downloadpttbbs-fd20564209c77de3975e708a5646731d76e62d92.tar
pttbbs-fd20564209c77de3975e708a5646731d76e62d92.tar.gz
pttbbs-fd20564209c77de3975e708a5646731d76e62d92.tar.bz2
pttbbs-fd20564209c77de3975e708a5646731d76e62d92.tar.lz
pttbbs-fd20564209c77de3975e708a5646731d76e62d92.tar.xz
pttbbs-fd20564209c77de3975e708a5646731d76e62d92.tar.zst
pttbbs-fd20564209c77de3975e708a5646731d76e62d92.zip
fix non-portable strtok() usage.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3293 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/friend.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index bde8e78d..e3fa11b6 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -256,6 +256,7 @@ inline void friend_load_real(int tosort, int maxf,
FILE *fp;
short nFriends = 0;
int uid, *tarray;
+ char *p;
setuserfile(genbuf, fn);
if( (fp = fopen(genbuf, "r")) == NULL ){
@@ -267,8 +268,8 @@ inline void friend_load_real(int tosort, int maxf,
tarray = (int *)malloc(sizeof(int) * maxf);
--maxf; /* 因為最後一個要填 0, 所以先扣一個回來 */
while( fgets(genbuf, STRLEN, fp) && nFriends < maxf )
- if( strtok(genbuf, str_space) &&
- (uid = searchuser(genbuf, NULL)) )
+ if( (p = strtok(genbuf, str_space)) &&
+ (uid = searchuser(p, NULL)) )
tarray[nFriends++] = uid;
fclose(fp);