mirror of
https://github.com/profanity-im/profanity.git
synced 2024-10-27 20:30:13 -04:00
Use g_strndup in c_api.c
This commit is contained in:
parent
ae003e62fb
commit
6c1fef522a
@ -365,9 +365,9 @@ static char *
|
||||
_c_plugin_name(const char *filename)
|
||||
{
|
||||
GString *plugin_name_str = g_string_new("");
|
||||
char *name = strndup(filename, strlen(filename)-1);
|
||||
gchar *name = g_strndup(filename, strlen(filename)-1);
|
||||
g_string_append(plugin_name_str, name);
|
||||
free(name);
|
||||
g_free(name);
|
||||
g_string_append(plugin_name_str, "so");
|
||||
char *result = plugin_name_str->str;
|
||||
g_string_free(plugin_name_str, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user