[gtk/ebassi/memdup2: 6/11] gdk: Move from g_memdup() to g_memdup2()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/memdup2: 6/11] gdk: Move from g_memdup() to g_memdup2()
- Date: Thu, 4 Feb 2021 19:48:13 +0000 (UTC)
commit 8ba877e2d6514211b69ce66951dcc016abfc4b5e
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Feb 4 19:16:02 2021 +0000
gdk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
gdk/gdkcontentproviderimpl.c | 2 +-
gdk/gdkevents.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkcontentproviderimpl.c b/gdk/gdkcontentproviderimpl.c
index aeeca742ba..dd4d7dc3a1 100644
--- a/gdk/gdkcontentproviderimpl.c
+++ b/gdk/gdkcontentproviderimpl.c
@@ -426,7 +426,7 @@ gdk_content_provider_new_union (GdkContentProvider **providers,
result = g_object_new (GDK_TYPE_CONTENT_PROVIDER_UNION, NULL);
result->n_providers = n_providers;
- result->providers = g_memdup (providers, sizeof (GdkContentProvider *) * n_providers);
+ result->providers = g_memdup2 (providers, sizeof (GdkContentProvider *) * n_providers);
for (i = 0; i < n_providers; i++)
{
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 177f06d494..2ce34f80ec 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -332,7 +332,7 @@ gdk_event_type_register_static (const char *type_name,
info.base_finalize = NULL;
info.class_init = gdk_event_generic_class_init;
info.class_finalize = NULL;
- info.class_data = g_memdup (type_info, sizeof (GdkEventTypeInfo));
+ info.class_data = g_memdup2 (type_info, sizeof (GdkEventTypeInfo));
info.instance_size = type_info->instance_size;
info.n_preallocs = 0;
@@ -1146,7 +1146,7 @@ gdk_event_dup_axes (GdkEvent *event)
if (gdk_event_get_axes (event, &axes, &n_axes))
{
- double *axes_copy = g_memdup (axes, n_axes * sizeof (double));
+ double *axes_copy = g_memdup2 (axes, n_axes * sizeof (double));
return axes_copy;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]