aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-25 18:08:08 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-25 18:08:16 +0200
commit511720945f9bb2c60fd61fded2c11f6da762b8a1 (patch)
tree28c152b03106bb7cca04d923880c7a0ff6fd13fc
parent70a1756f0996bf96809e7eb941ff78f107a1dd87 (diff)
fixed bug not allow sending empty message
-rw-r--r--v2/README.md1
-rw-r--r--v2/chatty.c2
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++;