diff options
| author | Raymaekers Luca <luca@keyfried.com> | 2024-10-26 01:55:22 +0200 |
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-26 01:55:22 +0200 |
| commit | 1465432ca609a540ebd01b023fc9e0b11794b4a8 (patch) | |
| tree | 986f8b8786fb7a078884e0e67cf647d585992ecc /v2 | |
| parent | c5c22aafabf5d47daa47918813e71fb7fe6ad73f (diff) | |
do not allow sending message to disconnected server
Diffstat (limited to 'v2')
| -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++; |
