1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

core: replace calls to malloc by string_asprintf

This commit is contained in:
Sébastien Helleu
2024-12-17 19:11:02 +01:00
parent 8f43dceedf
commit 818a4c95a9
22 changed files with 409 additions and 623 deletions
+4 -10
View File
@@ -226,20 +226,14 @@ gui_buffer_get_plugin_name (struct t_gui_buffer *buffer)
void
gui_buffer_build_full_name (struct t_gui_buffer *buffer)
{
int length;
if (!buffer)
return;
free (buffer->full_name);
length = strlen (gui_buffer_get_plugin_name (buffer)) + 1 +
strlen (buffer->name) + 1;
buffer->full_name = malloc (length);
if (buffer->full_name)
{
snprintf (buffer->full_name, length, "%s.%s",
gui_buffer_get_plugin_name (buffer), buffer->name);
}
string_asprintf (&buffer->full_name,
"%s.%s",
gui_buffer_get_plugin_name (buffer),
buffer->name);
}
/*