Merge pull request #368 from mariospr/glib-dep

Use g_key_file_load_from_data() instead of g_key_file_load_from_bytes()
tingping/wmclass
Alexander Larsson 2016-10-24 13:24:53 +02:00 committed by GitHub
commit db6f65b336
1 changed files with 5 additions and 1 deletions

View File

@ -231,6 +231,9 @@ load_options (const char *filename,
if (g_str_has_prefix (filename, "http:") ||
g_str_has_prefix (filename, "https:"))
{
const char *options_data;
gsize options_size;
bytes = download_uri (filename, &error);
if (bytes == NULL)
@ -239,7 +242,8 @@ load_options (const char *filename,
exit (1);
}
if (!g_key_file_load_from_bytes (keyfile, bytes, 0, &error))
options_data = g_bytes_get_data (bytes, &options_size);
if (!g_key_file_load_from_data (keyfile, options_data, options_size, 0, &error))
{
g_printerr ("Can't load uri %s: %s\n", filename, error->message);
exit (1);