tar: small fix and small optimization

This commit is contained in:
Denis Vlasenko
2006-11-25 23:47:32 +00:00
parent 43bddf31e9
commit 87cd4a87e3
2 changed files with 10 additions and 12 deletions

View File

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