diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-09 13:41:39 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-09 13:41:39 +0800 |
commit | 0f03a5af36d2c0284024e228873562c521773148 (patch) | |
tree | e26626eda6ce61a188975e99ea0c48743c5f892c | |
parent | b4021c3a39db31093577a29a75d2ad39252baf9e (diff) | |
download | pttbbs-0f03a5af36d2c0284024e228873562c521773148.tar pttbbs-0f03a5af36d2c0284024e228873562c521773148.tar.gz pttbbs-0f03a5af36d2c0284024e228873562c521773148.tar.bz2 pttbbs-0f03a5af36d2c0284024e228873562c521773148.tar.lz pttbbs-0f03a5af36d2c0284024e228873562c521773148.tar.xz pttbbs-0f03a5af36d2c0284024e228873562c521773148.tar.zst pttbbs-0f03a5af36d2c0284024e228873562c521773148.zip |
- talk: reduce GotoNewHand crash (C-Uhh or C-Urhh)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3980 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/talk.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 138dde54..70bcdb97 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -3487,20 +3487,29 @@ FindAngel(void){ static inline void GotoNewHand(){ - if (currutmp && currutmp->mode != EDITING){ - char old_board[IDLEN + 1] = ""; - if (currboard[0]) - strlcpy(old_board, currboard, IDLEN + 1); + char old_board[IDLEN + 1] = ""; + int canRead = 1; - if (enter_board(GLOBAL_NEWBIE)==0) { - Read(); - } + if (currutmp && currutmp->mode == EDITING) + return; - if (old_board[0]) - enter_board(old_board); + // usually crashed as 'assert(currbid == brc_currbid)' + if (currboard[0]) { + strlcpy(old_board, currboard, IDLEN + 1); + currboard = "";// force enter_board } + + if (enter_board(GLOBAL_NEWBIE) == 0) + canRead = 1; + + if (canRead) + Read(); + + if (canRead && old_board[0]) + enter_board(old_board); } + static inline void NoAngelFound(const char* msg){ move(b_lines, 0); |