aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/ar.c7
-rw-r--r--archival/rpm.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/archival/ar.c b/archival/ar.c
index a1bcb1f9c..1b43502ca 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -38,7 +38,7 @@ static void FAST_FUNC header_verbose_list_ar(const file_header_t *file_header)
38#define AR_OPT_INSERT 0x40 38#define AR_OPT_INSERT 0x40
39 39
40int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 40int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
41int ar_main(int argc, char **argv) 41int ar_main(int argc UNUSED_PARAM, char **argv)
42{ 42{
43 static const char msg_unsupported_err[] ALIGN1 = 43 static const char msg_unsupported_err[] ALIGN1 =
44 "archive %s is not supported"; 44 "archive %s is not supported";
@@ -51,6 +51,7 @@ int ar_main(int argc, char **argv)
51 /* Prepend '-' to the first argument if required */ 51 /* Prepend '-' to the first argument if required */
52 opt_complementary = "--:p:t:x:-1:p--tx:t--px:x--pt"; 52 opt_complementary = "--:p:t:x:-1:p--tx:t--px:x--pt";
53 opt = getopt32(argv, "ptxovcr"); 53 opt = getopt32(argv, "ptxovcr");
54 argv += optind;
54 55
55 if (opt & AR_CTX_PRINT) { 56 if (opt & AR_CTX_PRINT) {
56 archive_handle->action_data = data_extract_to_stdout; 57 archive_handle->action_data = data_extract_to_stdout;
@@ -76,9 +77,9 @@ int ar_main(int argc, char **argv)
76 77
77 archive_handle->src_fd = xopen(argv[optind++], O_RDONLY); 78 archive_handle->src_fd = xopen(argv[optind++], O_RDONLY);
78 79
79 while (optind < argc) { 80 while (*argv) {
80 archive_handle->filter = filter_accept_list; 81 archive_handle->filter = filter_accept_list;
81 llist_add_to(&(archive_handle->accept), argv[optind++]); 82 llist_add_to(&archive_handle->accept, *argv++);
82 } 83 }
83 84
84 unpack_ar_archive(archive_handle); 85 unpack_ar_archive(archive_handle);
diff --git a/archival/rpm.c b/archival/rpm.c
index 27c6b78a1..cdaf50fa9 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -116,7 +116,9 @@ int rpm_main(int argc, char **argv)
116 } 116 }
117 argv += optind; 117 argv += optind;
118 //argc -= optind; 118 //argc -= optind;
119 if (!argv[0]) bb_show_usage(); 119 if (!argv[0]) {
120 bb_show_usage();
121 }
120 122
121 while (*argv) { 123 while (*argv) {
122 rpm_fd = xopen(*argv++, O_RDONLY); 124 rpm_fd = xopen(*argv++, O_RDONLY);