aboutsummaryrefslogtreecommitdiff
path: root/commands.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-09 22:35:55 -0400
committerTest_User <hax@andrewyu.org>2024-06-09 22:35:55 -0400
commitea9db34ab8f514501506e69c5fa7d825adf50832 (patch)
tree90d904f6ec73f7a5c1929d8d6d2eedb2c50e50b4 /commands.c
parentc8507f711fd44ac68a4ff43b0aec4599e37cefd9 (diff)
downloadcoupserv-ea9db34ab8f514501506e69c5fa7d825adf50832.tar.gz
coupserv-ea9db34ab8f514501506e69c5fa7d825adf50832.zip
Fix missing argc check, fix warning message to contain the right number
Diffstat (limited to '')
-rw-r--r--commands.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/commands.c b/commands.c
index e25ada9..b3fb422 100644
--- a/commands.c
+++ b/commands.c
@@ -333,6 +333,11 @@ int sh_command(struct string sender, struct string original_message, struct stri
return 0;
}
+ if (argc < 2) {
+ privmsg(STRING("1HC000000"), to, 1, (struct string[]){STRING("Missing args!")});
+ return 0;
+ }
+
char wasspace = 1;
uint64_t offset = 0;
char found = 0;
@@ -347,7 +352,7 @@ int sh_command(struct string sender, struct string original_message, struct stri
}
if (found < 1) {
- WRITES(2, STRING("WARNING: Apparently there was no third argument... shouldn't happen.\n"));
+ WRITES(2, STRING("WARNING: Apparently there was no argument... shouldn't happen.\n"));
return 0;
}