From bd1b5094b40cb27bb0d894b843bbc407e03052ec Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Nov 2014 10:38:58 -0600 Subject: [PATCH] Trivial binfmt logic clean-up --- binfmt/binfmt_exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index 642eb4541d..4676164c50 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -124,8 +124,6 @@ static inline int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *ar /* Allocate the argv array and an argument buffer */ - i = 0; - if (argsize > 0) { argvsize = (nargs + 1) * sizeof(FAR char *); @@ -140,7 +138,7 @@ static inline int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *ar bin->argv = (FAR char **)bin->argbuffer; ptr = bin->argbuffer + argvsize; - for (; argv[i]; i++) + for (i = 0; argv[i]; i++) { bin->argv[i] = ptr; argsize = strlen(argv[i]) + 1;