From 5cfff4bc492dbb78c5622306a876a768cce0b6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Tue, 27 Sep 2022 16:50:22 +0300 Subject: [PATCH] Use g_memdump2 for glib 2.68 or greater MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit g_memdump is deprecated in glib 2.68.0. Signed-off-by: Björn Bidar --- librocketchat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/librocketchat.c b/librocketchat.c index dbd8262..c78b0c1 100644 --- a/librocketchat.c +++ b/librocketchat.c @@ -23,6 +23,10 @@ #define g_hash_table_contains(hash_table, key) g_hash_table_lookup_extended(hash_table, key, NULL, NULL) #endif /* 2.32.0 */ +#if !GLIB_CHECK_VERSION(2, 68, 0) && !PURPLE_VERSION_CHECK(2, 14, 2) +#define g_memdump2 g_memdump +#endif + static gboolean g_str_insensitive_equal(gconstpointer v1, gconstpointer v2) { @@ -3682,7 +3686,7 @@ rc_got_avatar(RocketChatAccount *ya, JsonNode *node, gpointer user_data, JsonObj response_str = g_dataset_get_data(node, "raw_body"); response_len = json_object_get_int_member(response, "len"); - response_dup = g_memdup(response_str, response_len); + response_dup = g_memdup2(response_str, response_len); purple_buddy_icons_set_for_user(ya->account, purple_buddy_get_name(buddy), response_dup, response_len, NULL); }