summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-18 15:23:35 +0200
committerJim Meyering <meyering@redhat.com>2009-08-18 17:20:06 +0200
commitdd922bedb7c3e85fbbe1eed10e371aec47138a1d (patch)
treec9f376373b02345dddcef43387772af4f303977f /src
parent1821af4d614aa8bd6a5b911217ac1f557a19820a (diff)
downloadlibguestfs-dd922bedb7c3e85fbbe1eed10e371aec47138a1d.tar.gz
libguestfs-dd922bedb7c3e85fbbe1eed10e371aec47138a1d.tar.xz
libguestfs-dd922bedb7c3e85fbbe1eed10e371aec47138a1d.zip
build: don't perform arithmetic on void* pointers
* src/guestfs.c (receive_file_data_sync, xread, xwrite): Use char*.
Diffstat (limited to 'src')
-rw-r--r--src/guestfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 1cd4f9ef..6eae6929 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -540,8 +540,9 @@ guestfs_safe_memdup (guestfs_h *g, void *ptr, size_t size)
}
static int
-xwrite (int fd, const void *buf, size_t len)
+xwrite (int fd, const void *v_buf, size_t len)
{
+ const char *buf = v_buf;
int r;
while (len > 0) {
@@ -557,8 +558,9 @@ xwrite (int fd, const void *buf, size_t len)
}
static int
-xread (int fd, void *buf, size_t len)
+xread (int fd, void *v_buf, size_t len)
{
+ char *buf = v_buf;
int r;
while (len > 0) {
@@ -2515,7 +2517,7 @@ receive_file_data_sync (guestfs_h *g, void **buf, size_t *len_r)
if (buf) {
*buf = safe_realloc (g, *buf, len + ctx.chunks[i].data.data_len);
- memcpy (*buf+len, ctx.chunks[i].data.data_val,
+ memcpy (((char *)*buf)+len, ctx.chunks[i].data.data_val,
ctx.chunks[i].data.data_len);
}
len += ctx.chunks[i].data.data_len;