summaryrefslogtreecommitdiff
path: root/archival/libunarchive/get_header_tar.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-25 23:47:32 +0000
committerDenis Vlasenko2006-11-25 23:47:32 +0000
commit87cd4a87e3f98dd5a1b982cfdfc4dad6800ca010 (patch)
treeba572c8880643df14a9803c30fd710ec8f9feedf /archival/libunarchive/get_header_tar.c
parent43bddf31e95080abf7232952da9064207636f47b (diff)
downloadbusybox-87cd4a87e3f98dd5a1b982cfdfc4dad6800ca010.zip
busybox-87cd4a87e3f98dd5a1b982cfdfc4dad6800ca010.tar.gz
tar: small fix and small optimization
Diffstat (limited to 'archival/libunarchive/get_header_tar.c')
-rw-r--r--archival/libunarchive/get_header_tar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index a49081f..b785d63 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);
}