[glib/mcatanzaro/glib-2-56-rhel8: 30/45] gdatainputstream: replace easy use of g_memdup()
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/mcatanzaro/glib-2-56-rhel8: 30/45] gdatainputstream: replace easy use of g_memdup()
- Date: Wed, 10 Nov 2021 22:05:59 +0000 (UTC)
commit 1aec11ec7463b8702f67201e3401269cb4669615
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Thu May 20 15:58:53 2021 -0500
gdatainputstream: replace easy use of g_memdup()
This code is passing a gsize, so might as well switch this to g_memdup2().
This is the only use of g_memdup() in GLib 2.56 that is not part of GLib
2.58. All other uses analyzed in glib!2000.
gio/gdatainputstream.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
index 9f207b158..ebef7c797 100644
--- a/gio/gdatainputstream.c
+++ b/gio/gdatainputstream.c
@@ -27,6 +27,7 @@
#include "gioenumtypes.h"
#include "gioerror.h"
#include "glibintl.h"
+#include "gstrfuncsprivate.h"
#include <string.h>
@@ -1082,7 +1083,7 @@ g_data_input_stream_read_async (GDataInputStream *stream,
data = g_slice_new0 (GDataInputStreamReadData);
if (stop_chars_len == -1)
stop_chars_len = strlen (stop_chars);
- data->stop_chars = g_memdup (stop_chars, stop_chars_len);
+ data->stop_chars = g_memdup2 (stop_chars, stop_chars_len);
data->stop_chars_len = stop_chars_len;
data->last_saw_cr = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]