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-04 22:56:55 +0300
committerAidan MacDonald <amachronic@protonmail.com>2021-11-05 03:24:35 +0300
commit14b9bf948fc6fb591d3b1db104ff546612377fb5 (patch)
tree0509f24464785b4dfdc4c01d4b32dea0c30b2e60
parent1bb9255348d02e2aff001ab60bdb51f8a60a9b87 (diff)
Report records with null type as regular files
This saves library users from checking for two possibilities and mirrors what we're doing in header_to_raw().
-rw-r--r--src/microtar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/microtar.c b/src/microtar.c
index 0ff038c..5ae7eeb 100644
--- a/src/microtar.c
+++ b/src/microtar.c
@@ -179,6 +179,8 @@ static int raw_to_header(mtar_header_t* h, const char* raw)
return rc;
h->type = raw[TYPE_OFF];
+ if(!h->type)
+ h->type = MTAR_TREG;
memcpy(h->name, &raw[NAME_OFF], NAME_LEN);
h->name[sizeof(h->name) - 1] = 0;