]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Read_open_memory does not alter the data passed to it, so should accept const void...
authorTim Kientzle <kientzle@acm.org>
Wed, 4 Mar 2015 04:12:50 +0000 (20:12 -0800)
committerTim Kientzle <kientzle@acm.org>
Wed, 4 Mar 2015 04:41:16 +0000 (20:41 -0800)
libarchive/archive.h
libarchive/archive_read_open_memory.c

index 1f0fc3874313a12208f3a5d743d400bc959b5f26..e1bf7a2be2f6fb76b22ac512099319b1196b3cf6 100644 (file)
@@ -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,
index bcc7d6f78e300265ca8913fe57debb165b510277..2d166a50fab305eaba06788f65b794ea465134d8 100644 (file)
@@ -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;