diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-11-03 11:46:49 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-11-03 11:46:49 +0000 |
commit | b8e556e5f54f2848bf1ad246189cb2bf44b643bd (patch) | |
tree | 69f4201cbef83f798e7e455c192b8fb4bde59566 | |
parent | 9c60b290717e3ff1b9a8e09da4abe6f46964aa82 (diff) | |
download | busybox-w32-b8e556e5f54f2848bf1ad246189cb2bf44b643bd.tar.gz busybox-w32-b8e556e5f54f2848bf1ad246189cb2bf44b643bd.tar.bz2 busybox-w32-b8e556e5f54f2848bf1ad246189cb2bf44b643bd.zip |
Add copyright notice and license, use strcat+strcpy instead of sprintf
-rw-r--r-- | archival/libunarchive/data_extract_all_prefix.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/archival/libunarchive/data_extract_all_prefix.c b/archival/libunarchive/data_extract_all_prefix.c index e4e93fc74..53f6b8aa4 100644 --- a/archival/libunarchive/data_extract_all_prefix.c +++ b/archival/libunarchive/data_extract_all_prefix.c | |||
@@ -1,11 +1,23 @@ | |||
1 | #include <sys/types.h> | 1 | /* |
2 | #include <errno.h> | 2 | * Copyright (C) by Glenn McGrath <bug1@optushome.com.au> |
3 | #include <fcntl.h> | 3 | * |
4 | #include <stdlib.h> | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | */ | ||
18 | |||
5 | #include <string.h> | 19 | #include <string.h> |
6 | #include <utime.h> | 20 | |
7 | #include <unistd.h> | ||
8 | #include <stdlib.h> | ||
9 | #include "libbb.h" | 21 | #include "libbb.h" |
10 | #include "unarchive.h" | 22 | #include "unarchive.h" |
11 | 23 | ||
@@ -16,7 +28,8 @@ extern void data_extract_all_prefix(archive_handle_t *archive_handle) | |||
16 | name_ptr += strspn(name_ptr, "./"); | 28 | name_ptr += strspn(name_ptr, "./"); |
17 | if (name_ptr[0] != '\0') { | 29 | if (name_ptr[0] != '\0') { |
18 | archive_handle->file_header->name = xmalloc(strlen(archive_handle->buffer) + 2 + strlen(name_ptr)); | 30 | archive_handle->file_header->name = xmalloc(strlen(archive_handle->buffer) + 2 + strlen(name_ptr)); |
19 | sprintf(archive_handle->file_header->name, "%s%s", archive_handle->buffer, name_ptr); | 31 | strcpy(archive_handle->file_header->name, archive_handle->buffer); |
32 | strcat(archive_handle->file_header->name, name_ptr); | ||
20 | data_extract_all(archive_handle); | 33 | data_extract_all(archive_handle); |
21 | } | 34 | } |
22 | return; | 35 | return; |