commit 8ca467b363e064c806417fad2a0d86e89c668f62
parent 2434a40db774fb83ff2214b1a871dca519449e6c
Author: Claudio Alessi <smoppy@gmail.com>
Date: Fri, 28 Jul 2017 00:21:48 +0200
Check the input in cmd_msg()
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/circo.c b/circo.c
@@ -253,8 +253,14 @@ cmd_msg(char *cmd, char *s) {
printb(sel, "You're offline.\n");
return;
}
+ trim(s);
to = s;
txt = skip(to, ' ');
+ if(!(*to && *txt)) {
+ printb(sel, "Usage: /%s <channel or user> <text>\n", cmd);
+ return;
+ }
+
privmsg(to, txt);
}