From: Tim Kientzle Date: Wed, 4 Mar 2015 04:12:50 +0000 (-0800) Subject: Read_open_memory does not alter the data passed to it, so should accept const void... X-Git-Tag: v3.1.900a~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be4d4ddcfca77f6e43753156eaa919f4d25ed903;p=thirdparty%2Flibarchive.git Read_open_memory does not alter the data passed to it, so should accept const void * arguments --- diff --git a/libarchive/archive.h b/libarchive/archive.h index 1f0fc3874..e1bf7a2be 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -494,9 +494,9 @@ __LA_DECL int archive_read_open_file(struct archive *, const char *_filename, size_t _block_size) __LA_DEPRECATED; /* Read an archive that's stored in memory. */ __LA_DECL int archive_read_open_memory(struct archive *, - void * buff, size_t size); + const void * buff, size_t size); /* A more involved version that is only used for internal testing. */ -__LA_DECL int archive_read_open_memory2(struct archive *a, void *buff, +__LA_DECL int archive_read_open_memory2(struct archive *a, const void *buff, size_t size, size_t read_size); /* Read an archive that's already open, using the file descriptor. */ __LA_DECL int archive_read_open_fd(struct archive *, int _fd, diff --git a/libarchive/archive_read_open_memory.c b/libarchive/archive_read_open_memory.c index bcc7d6f78..2d166a50f 100644 --- a/libarchive/archive_read_open_memory.c +++ b/libarchive/archive_read_open_memory.c @@ -54,7 +54,7 @@ static int64_t memory_read_skip(struct archive *, void *, int64_t request); static ssize_t memory_read(struct archive *, void *, const void **buff); int -archive_read_open_memory(struct archive *a, void *buff, size_t size) +archive_read_open_memory(struct archive *a, const void *buff, size_t size) { return archive_read_open_memory2(a, buff, size, size); } @@ -65,7 +65,7 @@ archive_read_open_memory(struct archive *a, void *buff, size_t size) * test harnesses can exercise block operations inside the library. */ int -archive_read_open_memory2(struct archive *a, void *buff, +archive_read_open_memory2(struct archive *a, const void *buff, size_t size, size_t read_size) { struct read_memory_data *mine;