summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2022-04-21 16:40:09 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2022-04-21 23:53:44 +0200
commitd5a888fa3130d2d05bf045c9ef90a3beaac54be8 (patch)
treecdd41bb8cac970b440a64675c6c461ac43b0b4fb
parent736fcea1d0377e6082e7cf738c3cd7cd42b3c1a0 (diff)
downloadlibnotify-d5a888fa3130d2d05bf045c9ef90a3beaac54be8.tar.gz
notification: Use g_memdup2 when available
It's not really an issue here, as we use a properly typed len, but better not to use a deprecated and potentially dangerous API.
-rw-r--r--libnotify/notification.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libnotify/notification.c b/libnotify/notification.c
index 1c442db..55cc46f 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -1056,7 +1056,11 @@ notify_notification_set_hint_byte_array (NotifyNotification *notification,
g_return_if_fail (value != NULL || len == 0);
+#ifdef GLIB_VERSION_2_68
+ value_dup = g_memdup2 (value, len);
+#else
value_dup = g_memdup (value, len);
+#endif
notify_notification_set_hint (notification, key,
g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
value_dup,