From d940baaa816c8fc1912359e6b6df7bc27f97fd31 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 1 Feb 2021 12:27:50 +0100 Subject: [PATCH] commandhelper: Split argument parsing and printing Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/commandhelper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 62e1b98c60..24373d6c07 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -75,8 +75,6 @@ int main(int argc, char **argv) { goto cleanup; for (i = 1; i < argc; i++) { - fprintf(log, "ARG:%s\n", argv[i]); - if (STREQ(argv[i - 1], "--readfd") && sscanf(argv[i], "%u%c", &readfds[numreadfds++], &c) != 1) { printf("Could not parse fd %s\n", argv[i]); @@ -88,6 +86,10 @@ int main(int argc, char **argv) { } } + for (i = 1; i < argc; i++) { + fprintf(log, "ARG:%s\n", argv[i]); + } + for (n = 0; environ[n]; n++) { }