[util] Fix glib deprecation warning re g_memdup()

This commit is contained in:
Behdad Esfahbod 2021-08-19 15:55:21 -06:00
parent dc800ffd6c
commit 7115af23eb
1 changed files with 7 additions and 1 deletions

View File

@ -64,7 +64,13 @@ struct subset_main_t : option_parser_t, face_options_t, output_options_t<false>
g_option_context_set_ignore_unknown_options (parser.context, true);
g_option_context_set_help_enabled (parser.context, false);
char **args = (char **) g_memdup (argv, argc * sizeof (*argv));
char **args = (char **)
#if GLIB_CHECK_VERSION (2, 68, 0)
g_memdup2
#else
g_memdup
#endif
(argv, argc * sizeof (*argv));
parser.parse (&argc, &args, true);
g_free (args);