diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-29 23:17:08 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-29 23:17:08 +0800 |
commit | ba8c5e618e1b2cee24554abf3d51118019aa4c0e (patch) | |
tree | e4c3380a61a0408b68adb246107887f8fafb2393 | |
parent | a11d747015c5698ced27e99c77bab5dd272b5c32 (diff) | |
download | pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.tar pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.tar.gz pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.tar.bz2 pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.tar.lz pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.tar.xz pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.tar.zst pttbbs-ba8c5e618e1b2cee24554abf3d51118019aa4c0e.zip |
prevent from search_ulist_userid() returning NULL
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3116 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/chess.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/chess.c b/mbbsd/chess.c index ebe25e16..e9eca609 100644 --- a/mbbsd/chess.c +++ b/mbbsd/chess.c @@ -1151,8 +1151,13 @@ ChessInitUser(ChessInfo* info) case CHESS_MODE_WATCH: uinfo = search_ulist_userid(currutmp->mateid); - strlcpy(userid[0], uinfo->userid, sizeof(userid[0])); - strlcpy(userid[1], uinfo->mateid, sizeof(userid[1])); + if (uinfo) { + strlcpy(userid[0], uinfo->userid, sizeof(userid[0])); + strlcpy(userid[1], uinfo->mateid, sizeof(userid[1])); + } else { + strlcpy(userid[0], currutmp->userid, sizeof(userid[0])); + userid[1][0] = 0; + } break; case CHESS_MODE_VERSUS: |