diff --git a/zathura/utils.c b/zathura/utils.c index f1bd422..a995eb7 100644 --- a/zathura/utils.c +++ b/zathura/utils.c @@ -195,9 +195,7 @@ zathura_get_version_string(zathura_t* zathura, bool markup) GString* string = g_string_new(NULL); /* zathura version */ - char* zathura_version = g_strdup_printf("zathura %d.%d.%d", ZATHURA_VERSION_MAJOR, ZATHURA_VERSION_MINOR, ZATHURA_VERSION_REV); - g_string_append(string, zathura_version); - g_free(zathura_version); + g_string_append_printf(string, "zathura %d.%d.%d", ZATHURA_VERSION_MAJOR, ZATHURA_VERSION_MINOR, ZATHURA_VERSION_REV); const char* format = (markup == true) ? "\n(plugin) %s (%d.%d.%d) (%s)" : "\n(plugin) %s (%d.%d.%d) (%s)"; @@ -207,15 +205,12 @@ zathura_get_version_string(zathura_t* zathura, bool markup) GIRARA_LIST_FOREACH(plugins, zathura_plugin_t*, iter, plugin) { char* name = zathura_plugin_get_name(plugin); zathura_plugin_version_t version = zathura_plugin_get_version(plugin); - char* text = g_strdup_printf(format, - (name == NULL) ? "-" : name, - version.major, - version.minor, - version.rev, - zathura_plugin_get_path(plugin) - ); - g_string_append(string, text); - g_free(text); + g_string_append_printf(string, format, + (name == NULL) ? "-" : name, + version.major, + version.minor, + version.rev, + zathura_plugin_get_path(plugin)); } GIRARA_LIST_FOREACH_END(plugins, zathura_plugin_t*, iter, plugin); }