diff options
-rw-r--r-- | v2/README.md | 1 | ||||
-rw-r--r-- | v2/chatty.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/v2/README.md b/v2/README.md index f853630..2f1e648 100644 --- a/v2/README.md +++ b/v2/README.md @@ -15,6 +15,7 @@ The idea is the following: - wrapping messages - prompt - sending message +- [x] bug: do not allow sending empty message ## server - log messages diff --git a/v2/chatty.c b/v2/chatty.c index 4074b77..ec850de 100644 --- a/v2/chatty.c +++ b/v2/chatty.c @@ -219,6 +219,8 @@ int main(int argc, char **argv) exit = 1; break; case TB_KEY_CTRL_M: // send message + if (input_len == 0) + break; // null terminate input[input_len] = 0; input_len++; |