diff options
-rw-r--r-- | v2/chatty.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/v2/chatty.c b/v2/chatty.c index 78c0ab1..3c26f66 100644 --- a/v2/chatty.c +++ b/v2/chatty.c @@ -415,7 +415,12 @@ int main(int argc, char **argv) break; case TB_KEY_CTRL_M: // send message if (input_len == 0) + // do not send empty message break; + if (fds[FDS_SERVER].fd == -1) + // do not send message to disconnected server + break; + // null terminate input[input_len] = 0; input_len++; |