diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/talk.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 56f1d4bd..503eac7a 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -674,6 +674,10 @@ my_write(pid_t pid, const char *prompt, const char *id, int flag, userinfo_t * p uin = (puin != NULL) ? puin : (userinfo_t *) search_ulist_pid(pid); strlcpy(destid, id, sizeof(destid)); + /* what if uin is NULL but other conditions are not true? + * will this situation cause SEGV? + * should this "!uin &&" replaced by "!uin ||" ? + */ if (!uin && !((flag == WATERBALL_GENERAL #ifdef PLAY_ANGEL || flag == WATERBALL_ANGEL || flag == WATERBALL_ANSWER @@ -706,10 +710,14 @@ my_write(pid_t pid, const char *prompt, const char *id, int flag, userinfo_t * p move(1, 0); clrtoeol(); outs(ANSI_COLOR(1;31) "你的呼叫器目前不接受別人丟水球,對方可能無法回話。" ANSI_RESET); break; + case PAGER_FRIENDONLY: - fri_stat = friend_stat(currutmp, uin); - if(fri_stat & HFM) - break; + if (uin) + { + fri_stat = friend_stat(currutmp, uin); + if(fri_stat & HFM) + break; + } move(1, 0); clrtoeol(); outs(ANSI_COLOR(1;31) "你的呼叫器目前只接受好友丟水球,對方可能無法回話。" ANSI_RESET); break; |