diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-26 02:47:32 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-26 02:47:32 +0300 |
commit | 87cd4a87e3f98dd5a1b982cfdfc4dad6800ca010 (patch) | |
tree | ba572c8880643df14a9803c30fd710ec8f9feedf /archival/libunarchive/get_header_tar.c | |
parent | 43bddf31e95080abf7232952da9064207636f47b (diff) |
tar: small fix and small optimization
Diffstat (limited to 'archival/libunarchive/get_header_tar.c')
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index a49081f40..b785d631d 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -152,9 +152,11 @@ char get_header_tar(archive_handle_t *archive_handle) if (!longname && parse_names) { /* we trash mode[0] here, it's ok */ tar.name[sizeof(tar.name)] = '\0'; - if (tar.prefix[0]) + if (tar.prefix[0]) { + /* and padding[0] */ + tar.prefix[sizeof(tar.prefix)] = '\0'; file_header->name = concat_path_file(tar.prefix, tar.name); - else + } else file_header->name = xstrdup(tar.name); } |