extensions/m_remove: simplify the reason building code, pointed out by mniip
This commit is contained in:
parent
1bb3786ddb
commit
49c12c23f9
1 changed files with 3 additions and 7 deletions
|
@ -227,16 +227,12 @@ m_remove(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
static void
|
static void
|
||||||
remove_quote_part(hook_data_privmsg_channel *data)
|
remove_quote_part(hook_data_privmsg_channel *data)
|
||||||
{
|
{
|
||||||
size_t ret;
|
|
||||||
if (data->approved || EmptyString(data->text) || data->msgtype != MESSAGE_TYPE_PART)
|
if (data->approved || EmptyString(data->text) || data->msgtype != MESSAGE_TYPE_PART)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rb_strlcpy(part_buf, "\"", sizeof(part_buf));
|
rb_strlcpy(part_buf, "\"", sizeof(part_buf) - 1);
|
||||||
ret = rb_strlcat(part_buf, data->text, sizeof(part_buf));
|
rb_strlcat(part_buf, data->text, sizeof(part_buf) - 1);
|
||||||
if (ret >= sizeof(part_buf) - 1)
|
rb_strlcat(part_buf, "\"", sizeof(part_buf));
|
||||||
part_buf[REASONLEN - 1] = '"';
|
|
||||||
else
|
|
||||||
rb_strlcat(part_buf, "\"", sizeof(part_buf));
|
|
||||||
|
|
||||||
data->text = part_buf;
|
data->text = part_buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue