summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-03-23 11:03:52 -0400
committerRay Strode <rstrode@redhat.com>2018-04-03 10:50:16 -0400
commitcda7a100f38eb93e2ff1b93a1505ae33bb0c0cac (patch)
tree53e7a7de3008879297f58d3a31a4642c2585e704
parent25242465c21fe7d3af1ed53f58e47e2e1728fa80 (diff)
downloadpolkit-cda7a100f38eb93e2ff1b93a1505ae33bb0c0cac.tar.gz
jsauthority: stop using JS_GetStringCharsZ
it's not around anymore. Signed-off-by: Ray Strode <rstrode@redhat.com> https://bugs.freedesktop.org/show_bug.cgi?id=105865
-rw-r--r--src/polkitbackend/polkitbackendjsauthority.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
index 80bf06e..686de3f 100644
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
@@ -1090,7 +1090,7 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
JS::RootedValue rval(authority->priv->cx);
guint n;
GError *error = NULL;
- JSString *ret_jsstr;
+ JS::RootedString ret_jsstr (authority->priv->cx);
gchar *ret_str = NULL;
gchar **ret_strs = NULL;
@@ -1137,10 +1137,10 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
}
ret_jsstr = rval.toString();
- ret_str = g_utf16_to_utf8 (JS_GetStringCharsZ (authority->priv->cx, ret_jsstr), -1, NULL, NULL, NULL);
+ ret_str = JS_EncodeStringToUTF8 (authority->priv->cx, ret_jsstr);
if (ret_str == NULL)
{
- g_warning ("Error converting resulting string to UTF-8: %s", error->message);
+ g_warning ("Error converting resulting string to UTF-8");
goto out;
}
@@ -1197,8 +1197,7 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
JS::AutoValueArray<2> args(authority->priv->cx);
JS::RootedValue rval(authority->priv->cx);
GError *error = NULL;
- JSString *ret_jsstr;
- const jschar *ret_utf16;
+ JS::RootedString ret_jsstr (authority->priv->cx);
gchar *ret_str = NULL;
gboolean good = FALSE;
@@ -1252,12 +1251,10 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
}
ret_jsstr = rval.toString();
- ret_utf16 = JS_GetStringCharsZ (authority->priv->cx, ret_jsstr);
- ret_str = g_utf16_to_utf8 (ret_utf16, -1, NULL, NULL, &error);
+ ret_str = JS_EncodeStringToUTF8 (authority->priv->cx, ret_jsstr);
if (ret_str == NULL)
{
- g_warning ("Error converting resulting string to UTF-8: %s", error->message);
- g_clear_error (&error);
+ g_warning ("Error converting resulting string to UTF-8");
goto out;
}