aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/libunarchive/get_header_tar.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 54c8f7665..beaf3087f 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -217,9 +217,7 @@ char get_header_tar(archive_handle_t *archive_handle)
217 } 217 }
218 file_header->link_target = NULL; 218 file_header->link_target = NULL;
219 if (!linkname && parse_names && tar.linkname[0]) { 219 if (!linkname && parse_names && tar.linkname[0]) {
220 /* we trash magic[0] here, it's ok */ 220 file_header->link_target = xstrndup(tar.linkname, sizeof(tar.linkname));
221 tar.linkname[sizeof(tar.linkname)] = '\0';
222 file_header->link_target = xstrdup(tar.linkname);
223 /* FIXME: what if we have non-link object with link_target? */ 221 /* FIXME: what if we have non-link object with link_target? */
224 /* Will link_target be free()ed? */ 222 /* Will link_target be free()ed? */
225 } 223 }
@@ -237,10 +235,12 @@ char get_header_tar(archive_handle_t *archive_handle)
237 file_header->name = NULL; 235 file_header->name = NULL;
238 if (!longname && parse_names) { 236 if (!longname && parse_names) {
239 /* we trash mode[0] here, it's ok */ 237 /* we trash mode[0] here, it's ok */
240 tar.name[sizeof(tar.name)] = '\0'; 238 //tar.name[sizeof(tar.name)] = '\0'; - gcc 4.3.0 would complain
239 tar.mode[0] = '\0';
241 if (tar.prefix[0]) { 240 if (tar.prefix[0]) {
242 /* and padding[0] */ 241 /* and padding[0] */
243 tar.prefix[sizeof(tar.prefix)] = '\0'; 242 //tar.prefix[sizeof(tar.prefix)] = '\0'; - gcc 4.3.0 would complain
243 tar.padding[0] = '\0';
244 file_header->name = concat_path_file(tar.prefix, tar.name); 244 file_header->name = concat_path_file(tar.prefix, tar.name);
245 } else 245 } else
246 file_header->name = xstrdup(tar.name); 246 file_header->name = xstrdup(tar.name);