Module: xenomai-3
Branch: master
Commit: 5f6b32f9b82428ea798e0f2d7718ea4752e96ab1
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5f6b32f9b82428ea798e0f2d7718ea4752e96ab1

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sat Oct 31 20:57:40 2015 +0100

lib/smokey: fix argument parsing

---

 lib/smokey/helpers.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 6c7d3d7..7e95558 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -84,12 +84,12 @@ int smokey_string(const char *s, struct smokey_arg *arg)
 int smokey_parse_args(struct smokey_test *t,
                      int argc, char *const argv[])
 {
-       int matched = 0, n = 0, ac;
+       int matched = 0, n, ac;
        struct smokey_arg *arg;
 
-       while (++n < argc) {
-               for (arg = t->args, ac = 0;
-                    arg->name && ac < t->nargs; arg++, ac++) {
+       for (arg = t->args, ac = 0;
+            arg->name && ac < t->nargs; arg++, ac++) {
+               for (n = 1; n < argc; n++) {
                        arg->matched = !!arg->parser(argv[n], arg);
                        if (arg->matched) {
                                matched++;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to