From 27dac123f492b58f66045498c1e6563246f52d1b Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 12 Jan 2023 20:03:42 +0100 Subject: [PATCH] fix: Make minitar_read_contents() take a const pointer to entry --- minitar.h | 2 +- src/tar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/minitar.h b/minitar.h index 1d636ab..34a49fc 100644 --- a/minitar.h +++ b/minitar.h @@ -51,7 +51,7 @@ extern "C" int minitar_find_by_name(struct minitar* mp, const char* name, struct minitar_entry* out); int minitar_find_by_path(struct minitar* mp, const char* path, struct minitar_entry* out); int minitar_find_any_of(struct minitar* mp, enum minitar_file_type type, struct minitar_entry* out); - size_t minitar_read_contents(struct minitar* mp, struct minitar_entry* entry, char* buf, size_t max); + size_t minitar_read_contents(struct minitar* mp, const struct minitar_entry* entry, char* buf, size_t max); int minitar_close(struct minitar* mp); #ifdef __cplusplus diff --git a/src/tar.c b/src/tar.c index a5b6570..1242e82 100644 --- a/src/tar.c +++ b/src/tar.c @@ -111,7 +111,7 @@ int minitar_find_any_of(struct minitar* mp, enum minitar_file_type type, struct return -1; } -size_t minitar_read_contents(struct minitar* mp, struct minitar_entry* entry, char* buf, size_t max) +size_t minitar_read_contents(struct minitar* mp, const struct minitar_entry* entry, char* buf, size_t max) { if (!max) return 0; if (!entry->metadata.size) return 0;