Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/amachronic/microtar.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-23 22:29:27 +0300
committerAidan MacDonald <amachronic@protonmail.com>2021-11-25 23:29:08 +0300
commitf9b7c9b648d1eaf0f84eb5bd6d79c3863a9421be (patch)
tree136d9fe520dc5071e476363be4ea54570b5d205c
parentc747f93a4fa5119f9e384e5f43581d44ba3cdaa6 (diff)
Return non-const header from mtar_get_header()
Rationale: it can be updated and passed to mtar_header_update(), saving a temporary, and without poking around the struct fields.
-rw-r--r--src/microtar.c2
-rw-r--r--src/microtar.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/microtar.c b/src/microtar.c
index ca01d9e..eaf4f34 100644
--- a/src/microtar.c
+++ b/src/microtar.c
@@ -332,7 +332,7 @@ int mtar_is_open(mtar_t* tar)
return (tar->ops != NULL) ? 1 : 0;
}
-const mtar_header_t* mtar_get_header(const mtar_t* tar)
+mtar_header_t* mtar_get_header(mtar_t* tar)
{
if(tar->state & S_HEADER_VALID)
return &tar->header;
diff --git a/src/microtar.h b/src/microtar.h
index 6d45183..7a9be2a 100644
--- a/src/microtar.h
+++ b/src/microtar.h
@@ -106,7 +106,7 @@ void mtar_init(mtar_t* tar, int access, const mtar_ops_t* ops, void* stream);
int mtar_close(mtar_t* tar);
int mtar_is_open(mtar_t* tar);
-const mtar_header_t* mtar_get_header(const mtar_t* tar);
+mtar_header_t* mtar_get_header(mtar_t* tar);
int mtar_access_mode(const mtar_t* tar);
int mtar_rewind(mtar_t* tar);