[gupnp-tools] av-cp: Use g_memdup2 where available
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-tools] av-cp: Use g_memdup2 where available
- Date: Thu, 20 May 2021 14:46:41 +0000 (UTC)
commit 6359cc4bdea34a61ef8d6b18ec06748028a186fa
Author: Jens Georg <mail jensge org>
Date: Thu May 20 16:46:15 2021 +0200
av-cp: Use g_memdup2 where available
src/universal-cp/event-treeview.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/src/universal-cp/event-treeview.c b/src/universal-cp/event-treeview.c
index f9d9cd1..4d8f2a2 100644
--- a/src/universal-cp/event-treeview.c
+++ b/src/universal-cp/event-treeview.c
@@ -309,7 +309,11 @@ get_display_value (const char *value)
if (size > MAX_VALUE_SIZE)
size = MAX_VALUE_SIZE;
+#if GLIB_CHECK_VERSION(2,68,0)
+ display_value = g_memdup2 (value, size + 1);
+#else
display_value = g_memdup (value, size + 1);
+#endif
display_value[size] = '\0';
return display_value;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]