From 49c12c23f9aff623be5a5d8696b0d5bf1885a31f Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 10 Jan 2016 22:27:28 -0600 Subject: [PATCH] extensions/m_remove: simplify the reason building code, pointed out by mniip --- extensions/m_remove.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/extensions/m_remove.c b/extensions/m_remove.c index df6743b1..e9a3e646 100644 --- a/extensions/m_remove.c +++ b/extensions/m_remove.c @@ -227,16 +227,12 @@ m_remove(struct Client *client_p, struct Client *source_p, int parc, const char static void remove_quote_part(hook_data_privmsg_channel *data) { - size_t ret; if (data->approved || EmptyString(data->text) || data->msgtype != MESSAGE_TYPE_PART) return; - rb_strlcpy(part_buf, "\"", sizeof(part_buf)); - ret = rb_strlcat(part_buf, data->text, sizeof(part_buf)); - if (ret >= sizeof(part_buf) - 1) - part_buf[REASONLEN - 1] = '"'; - else - rb_strlcat(part_buf, "\"", sizeof(part_buf)); + rb_strlcpy(part_buf, "\"", sizeof(part_buf) - 1); + rb_strlcat(part_buf, data->text, sizeof(part_buf) - 1); + rb_strlcat(part_buf, "\"", sizeof(part_buf)); data->text = part_buf; }