From bf428312d78aa83772c7bf3f7324e87173b8c7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 7 Mar 2012 14:47:51 +0100 Subject: [PATCH] networkAgent: Fix external-ui dialogs Two small fixes which made _showNewStyleDialog() err out: - g_key_file_load_from_data() expects a string as first argument, but g_buffered_input_stream_peek_buffer() returns an array of "data" - g_key_file_load_from_data() is documented to allow -1 as length parameter for \0-terminated strings, but the actual type of the parameter is unsigned (d'uh) https://bugzilla.gnome.org/show_bug.cgi?id=671556 --- js/ui/networkAgent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js index bc3633351..cc44fa2ab 100644 --- a/js/ui/networkAgent.js +++ b/js/ui/networkAgent.js @@ -531,7 +531,8 @@ const VPNRequestHandler = new Lang.Class({ let contentOverride; try { - keyfile.load_from_data(this._dataStdout.peek_buffer(), -1, + let data = this._dataStdout.peek_buffer(); + keyfile.load_from_data(data.toString(), data.length, GLib.KeyFileFlags.NONE); if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)