(mc_args__convert_help_to_syscharset): return GString.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-05-21 11:33:09 +03:00
parent 0a9ecdeb98
commit 6fecb7a9e8

View File

@ -416,7 +416,7 @@ mc_args_add_extended_info_to_help (void)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
static gchar * static GString *
mc_args__convert_help_to_syscharset (const gchar * charset, const gchar * error_message_str, mc_args__convert_help_to_syscharset (const gchar * charset, const gchar * error_message_str,
const gchar * help_str) const gchar * help_str)
{ {
@ -433,7 +433,7 @@ mc_args__convert_help_to_syscharset (const gchar * charset, const gchar * error_
g_free (full_help_str); g_free (full_help_str);
g_iconv_close (conv); g_iconv_close (conv);
return g_string_free (buffer, FALSE); return buffer;
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -695,13 +695,13 @@ mc_args_parse (int *argc, char ***argv, const char *translation_domain, GError *
help_str); help_str);
else else
{ {
gchar *full_help_str; GString *full_help_str;
full_help_str = full_help_str =
mc_args__convert_help_to_syscharset (_system_codepage, (*mcerror)->message, mc_args__convert_help_to_syscharset (_system_codepage, (*mcerror)->message,
help_str); help_str);
mc_replace_error (mcerror, (*mcerror)->code, "%s", full_help_str); mc_replace_error (mcerror, (*mcerror)->code, "%s", full_help_str->str);
g_free (full_help_str); g_string_free (full_help_str, TRUE);
} }
g_free (help_str); g_free (help_str);
} }