]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/io.c
read_write_all: avoid arithmetic on void pointers.
[ccan] / ccan / tdb2 / io.c
index 0e27e1d0faea07a2d8640e46db187a0298afcfb8..bb3d2192829dc504a885e06176f6a2e275c2bcd8 100644 (file)
@@ -342,7 +342,7 @@ enum TDB_ERROR tdb_write_off(struct tdb_context *tdb,
 static void *_tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset,
                             tdb_len_t len, unsigned int prefix)
 {
-       void *buf;
+       unsigned char *buf;
        enum TDB_ERROR ecode;
 
        /* some systems don't like zero length malloc */
@@ -439,7 +439,7 @@ static enum TDB_ERROR tdb_expand_file(struct tdb_context *tdb,
 const void *tdb_access_read(struct tdb_context *tdb,
                            tdb_off_t off, tdb_len_t len, bool convert)
 {
-       const void *ret = NULL;
+       void *ret = NULL;
 
        if (likely(!(tdb->flags & TDB_CONVERT))) {
                ret = tdb->methods->direct(tdb, off, len, false);