From 6f8bc0d2703a23a7d166fd9e113fc7e7d307e2b4 Mon Sep 17 00:00:00 2001 From: Blair Bonnett Date: Tue, 14 Aug 2012 12:08:31 +1200 Subject: [PATCH] Broadcast command: escape the message so it sends properly. --- src/core/commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/commands.c b/src/core/commands.c index fb3256c..e6651d7 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -450,7 +450,7 @@ static int command_whoip(struct command_base* cbase, struct hub_user* user, stru static int command_broadcast(struct command_base* cbase, struct hub_user* user, struct hub_command* cmd) { struct hub_command_arg_data* arg = hub_command_arg_next(cmd, type_string); - char* message = arg->data.string; + char* message = adc_msg_escape(arg->data.string); size_t message_len = strlen(message); char pm_flag[7] = "PM"; char from_sid[5]; @@ -485,6 +485,7 @@ static int command_broadcast(struct command_base* cbase, struct hub_user* user, cbuf_append_format(buf, "*** %s: Delivered to " PRINTF_SIZE_T " user%s", cmd->prefix, recipients, (recipients != 1 ? "s" : "")); send_message(cbase, user, buf); + free(message); return 0; }