fix: Make minitar_read_contents() take a const pointer to entry

This commit is contained in:
apio 2023-01-12 20:03:42 +01:00
parent 912b98d2d7
commit 27dac123f4
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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;