summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-05-05 03:37:09 -0400
committerTest_User <hax@andrewyu.org>2023-05-05 03:37:09 -0400
commit9343cffa8c032d5b44fce89af7fc5d8709acd9aa (patch)
tree6498e35723a0bc72da07cebddf41ffca88cc0171 /main.c
parent658cd5f4c8f2d18b263d5bcb992b3aa995470312 (diff)
downloadcoupserv-9343cffa8c032d5b44fce89af7fc5d8709acd9aa.tar.gz
coupserv-9343cffa8c032d5b44fce89af7fc5d8709acd9aa.zip
Add more commands, remove trailing ; from macro
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 8d18640..8e0e97b 100644
--- a/main.c
+++ b/main.c
@@ -181,10 +181,14 @@ int main(void) {
int (*func)(struct string source, uint64_t argc, struct string *argv) = get_table_index(network_commands, command);
if (func == 0) {
- WRITES(1, STRING("WARNING: Command is unknown, ignoring...\n"));
+ WRITES(2, STRING("WARNING: Command is unknown, ignoring...\n"));
} else {
write(1, "\n", 1);
- func(source, argc, argv);
+ int err = func(source, argc, argv);
+ if (err) {
+ WRITES(1, STRING("Disconnecting by result of the network command handler...\n"));
+ return 0;
+ }
}
write(1, "\n", 1);