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:
Alexander Larsson 2008-01-15 11:47:04 +00:00 committed by Alexander Larsson
parent 5fa9ff14a9
commit a1996e6518
3 changed files with 10 additions and 3 deletions

View File

@ -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>
* === Released 2.15.2 ===

View File

@ -283,7 +283,7 @@ g_memory_input_stream_read (GInputStream *stream,
chunk = (Chunk *)l->data;
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;
start = 0;

View File

@ -313,7 +313,7 @@ array_resize (GMemoryOutputStream *ostream,
}
if (size > len)
memset (data + len, 0, size - len);
memset ((guint8 *)data + len, 0, size - len);
priv->data = data;
priv->len = size;
@ -365,7 +365,7 @@ g_memory_output_stream_write (GOutputStream *stream,
only added part of the required memory */
count = MIN (count, priv->len - priv->pos);
dest = priv->data + priv->pos;
dest = (guint8 *)priv->data + priv->pos;
memcpy (dest, buffer, count);
priv->pos += count;