From 1d3822ee8b2263be472e13ea685e7beb69071fb1 Mon Sep 17 00:00:00 2001 From: fwsmit Date: Tue, 6 Apr 2021 19:48:25 +0200 Subject: [PATCH] icon: Replace deprecated g_memdup with g_memdup2 where possible This avoids a potential conversion from gsize to guint and silences a warning. --- src/icon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/icon.c b/src/icon.c index fdca559..d3d067d 100644 --- a/src/icon.c +++ b/src/icon.c @@ -347,7 +347,13 @@ GdkPixbuf *icon_get_for_data(GVariant *data, char **id) return NULL; } + // g_memdup is deprecated in glib 2.67.4 and higher. + // g_memdup2 is a safer alternative +#if GLIB_CHECK_VERSION(2,67,3) + data_pb = (guchar *) g_memdup2(g_variant_get_data(data_variant), len_actual); +#else data_pb = (guchar *) g_memdup(g_variant_get_data(data_variant), len_actual); +#endif pixbuf = gdk_pixbuf_new_from_data(data_pb, GDK_COLORSPACE_RGB,