From f6bed7bc7f055feb21b1b2bd40817a3ed494b695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Gl=C3=A4=C3=9Fle?= Date: Tue, 7 Jul 2015 06:40:36 +0200 Subject: [PATCH] The 'ay' type seems to be working fine According to [1] the glib binding somehow doesn't handle 'ay' correctly and we therefore need 'a(y)'. I don't exactly get what this means and whether this is obsolete: 'ay' appears to be working fine so far. 1: http://stackoverflow.com/a/24908253/650222 --- src/udiskslinuxencrypted.c | 4 ++-- tools/udisksctl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c index 05b5ead..f52d4a9 100644 --- a/src/udiskslinuxencrypted.c +++ b/src/udiskslinuxencrypted.c @@ -237,14 +237,14 @@ lookup_binary_blob(GVariant* dict, const gchar* name, GString** contents) gsize size = 0; gsize index = 0; - if (!g_variant_lookup (dict, name, "a(y)", &iter)) + if (!g_variant_lookup (dict, name, "ay", &iter)) return FALSE; size = g_variant_iter_n_children (iter); *contents = g_string_sized_new (size); (*contents)->len = size; - while (g_variant_iter_loop (iter, "(y)", &byte)) + while (g_variant_iter_loop (iter, "y", &byte)) { (*contents)->str[index++] = byte; } diff --git a/tools/udisksctl.c b/tools/udisksctl.c index 168a680..a2738d1 100644 --- a/tools/udisksctl.c +++ b/tools/udisksctl.c @@ -1071,11 +1071,11 @@ pack_binary_blob(const gchar* data, gsize size) { GVariantBuilder builder; - g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(y)")); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay")); for (gsize i = 0; i < size; i++) { - g_variant_builder_add (&builder, "(y)", data[i]); + g_variant_builder_add (&builder, "y", data[i]); } return g_variant_builder_end (&builder); -- 2.10.2