about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-05 22:18:11 -0500
committerJune McEnroe <june@causal.agency>2020-02-05 22:18:11 -0500
commit63b92672fe9ecfd400d9439343a068a3ae5224df (patch)
tree5e321f02e2d8ab4aa5ac1a76e7f986363215208a
parentHandle empty messages on privmsg, notice, action (diff)
downloadcatgirl-63b92672fe9ecfd400d9439343a068a3ae5224df.tar.gz
catgirl-63b92672fe9ecfd400d9439343a068a3ae5224df.zip
Handle empty params in /quote
-rw-r--r--command.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/command.c b/command.c
index 2a3df9b..f9362dc 100644
--- a/command.c
+++ b/command.c
@@ -23,7 +23,7 @@ typedef void Command(size_t id, char *params);
 
 static void commandQuote(size_t id, char *params) {
 	(void)id;
-	ircFormat("%s\r\n", params);
+	if (params) ircFormat("%s\r\n", params);
 }
 
 static void commandPrivmsg(size_t id, char *params) {
@@ -65,8 +65,7 @@ static void commandQuit(size_t id, char *params) {
 
 static void commandWindow(size_t id, char *params) {
 	(void)id;
-	if (!params) return;
-	uiShowNum(strtoul(params, NULL, 10));
+	if (params) uiShowNum(strtoul(params, NULL, 10));
 }
 
 static const struct Handler {