Fix treatment of EOF from player
Commit79407e68
(v4.3.11) changed recvclient() to keep failing after receiving EOF from player. This was bad, because some places getting input check player->aborted instead of recvclient() failure, and player->aborted wasn't set on EOF. Bugs caused by this: * comm_bomb(), ship_bomb(), plane_bomb(), land_bomb() went into an infinite loop that eventually ate all memory. * deli(), desi(), dist(), fly(), morale(), zdon(), att_prompt(), ask_move_in() interpreted EOF as empty input instead of no more input. * cmd_sail_ship() dereferenced a null pointer. Fix by setting player->aborted on EOF, too. (cherry picked from commitb3a7a8ee11
)
This commit is contained in:
parent
80b57b2f95
commit
b9b0710128
3 changed files with 8 additions and 7 deletions
|
@ -76,7 +76,7 @@ struct player {
|
|||
int simulation; /* e.g. budget command */
|
||||
double dolcost;
|
||||
time_t curup; /* when last input was received */
|
||||
int aborted; /* interrupt cookie received? */
|
||||
int aborted; /* interrupt cookie or EOF received? */
|
||||
int eof; /* EOF (cookie or real) received? */
|
||||
int recvfail; /* #recvclient() failures */
|
||||
int curid; /* for pr, cur. line's id, -1 none */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue