about summary refs log tree commit diff stats
path: root/src/plugins
diff options
context:
space:
mode:
authorJohn Hernandez <129467592+H3rnand3zzz@users.noreply.github.com>2023-04-19 02:44:19 +0200
committerJohn Hernandez <129467592+H3rnand3zzz@users.noreply.github.com>2023-05-04 16:15:09 +0200
commit7f3fca2bd081a729d425184f7a0484025862257e (patch)
tree20f1cd78bf48f7d6ceb95bb0262faf691001bcf9 /src/plugins
parentfaccf24c759d7bddb4d3062c7f044e0c7640ffe7 (diff)
downloadprofani-tty-7f3fca2bd081a729d425184f7a0484025862257e.tar.gz
Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended.

Reason: improve compatibility and stability. Issue #1819

Minor refactoring.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/python_plugins.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/python_plugins.c b/src/plugins/python_plugins.c
index c32d177c..cf1e4a87 100644
--- a/src/plugins/python_plugins.c
+++ b/src/plugins/python_plugins.c
@@ -874,9 +874,8 @@ static void
 _python_undefined_error(ProfPlugin* plugin, char* hook, char* type)
 {
     GString* err_msg = g_string_new("Plugin error - ");
-    char* module_name = g_strndup(plugin->name, strlen(plugin->name) - 2);
+    auto_gchar gchar* module_name = g_strndup(plugin->name, strlen(plugin->name) - 2);
     g_string_append(err_msg, module_name);
-    free(module_name);
     g_string_append(err_msg, hook);
     g_string_append(err_msg, "(): return value undefined, expected ");
     g_string_append(err_msg, type);
@@ -889,9 +888,8 @@ static void
 _python_type_error(ProfPlugin* plugin, char* hook, char* type)
 {
     GString* err_msg = g_string_new("Plugin error - ");
-    char* module_name = g_strndup(plugin->name, strlen(plugin->name) - 2);
+    auto_gchar gchar* module_name = g_strndup(plugin->name, strlen(plugin->name) - 2);
     g_string_append(err_msg, module_name);
-    free(module_name);
     g_string_append(err_msg, hook);
     g_string_append(err_msg, "(): incorrect return type, expected ");
     g_string_append(err_msg, type);