mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 14:36:16 +01:00
Don't do pointer arithmetic on void * (#508602) Patch from Kazuki IWAMOTO
2008-01-15 Alexander Larsson <alexl@redhat.com> * gmemoryinputstream.c: * gmemoryoutputstream.c: Don't do pointer arithmetic on void * (#508602) Patch from Kazuki IWAMOTO svn path=/trunk/; revision=6316
This commit is contained in:
parent
5fa9ff14a9
commit
a1996e6518
@ -1,3 +1,10 @@
|
|||||||
|
2008-01-15 Alexander Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gmemoryinputstream.c:
|
||||||
|
* gmemoryoutputstream.c:
|
||||||
|
Don't do pointer arithmetic on void * (#508602)
|
||||||
|
Patch from Kazuki IWAMOTO
|
||||||
|
|
||||||
2008-01-14 Matthias Clasen <mclasen@redhat.com>
|
2008-01-14 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* === Released 2.15.2 ===
|
* === Released 2.15.2 ===
|
||||||
|
@ -283,7 +283,7 @@ g_memory_input_stream_read (GInputStream *stream,
|
|||||||
chunk = (Chunk *)l->data;
|
chunk = (Chunk *)l->data;
|
||||||
size = MIN (rest, chunk->len - start);
|
size = MIN (rest, chunk->len - start);
|
||||||
|
|
||||||
memcpy (buffer + (count - rest), chunk->data + start, size);
|
memcpy ((guint8 *)buffer + (count - rest), chunk->data + start, size);
|
||||||
rest -= size;
|
rest -= size;
|
||||||
|
|
||||||
start = 0;
|
start = 0;
|
||||||
|
@ -313,7 +313,7 @@ array_resize (GMemoryOutputStream *ostream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (size > len)
|
if (size > len)
|
||||||
memset (data + len, 0, size - len);
|
memset ((guint8 *)data + len, 0, size - len);
|
||||||
|
|
||||||
priv->data = data;
|
priv->data = data;
|
||||||
priv->len = size;
|
priv->len = size;
|
||||||
@ -365,7 +365,7 @@ g_memory_output_stream_write (GOutputStream *stream,
|
|||||||
only added part of the required memory */
|
only added part of the required memory */
|
||||||
count = MIN (count, priv->len - priv->pos);
|
count = MIN (count, priv->len - priv->pos);
|
||||||
|
|
||||||
dest = priv->data + priv->pos;
|
dest = (guint8 *)priv->data + priv->pos;
|
||||||
memcpy (dest, buffer, count);
|
memcpy (dest, buffer, count);
|
||||||
priv->pos += count;
|
priv->pos += count;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user