read_write_all: avoid arithmetic on void pointers.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 01:20:34 +0000 (11:50 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 01:20:34 +0000 (11:50 +1030)
ccan/read_write_all/read_write_all.c

index 406bd453e3e63c25b01635363700643e702b0bdf..92efd4298f7edb623225862512491451f0ae5df9 100644 (file)
@@ -12,7 +12,7 @@ bool write_all(int fd, const void *data, size_t size)
                        continue;
                if (done <= 0)
                        return false;
-               data += done;
+               data = (const char *)data + done;
                size -= done;
        }
 
@@ -29,7 +29,7 @@ bool read_all(int fd, void *data, size_t size)
                        continue;
                if (done <= 0)
                        return false;
-               data += done;
+               data = (char *)data + done;
                size -= done;
        }