parseline() was skipping over non-option commandline args with 3 for
loops that had empty bodies signified by semicolons at the end of the
for() line (twice) or with a body comprised completely of a nested
for() that had an empty body. Coverity didn't like this. Put braces
around all three loop bodies to make the intent more clear.
Signed-off-by: Laine Stump <laine(a)laine.org>
---
src/ncftool.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/ncftool.c b/src/ncftool.c
index 382c91d..eecb449 100644
--- a/src/ncftool.c
+++ b/src/ncftool.c
@@ -655,9 +655,12 @@ static int parseline(struct command *cmd, char *line) {
}
for (def = cmd->def->opts;
def->name != NULL && !opt_def_is_arg(def);
- def++);
- for (int i=0; i < curarg; i++)
- for (; def->name != NULL && !opt_def_is_arg(def); def++);
+ def++) {
+ }
+ for (int i=0; i < curarg; i++) {
+ for (; def->name != NULL && !opt_def_is_arg(def); def++) {
+ }
+ }
struct command_opt *opt =
make_command_opt(cmd, def);
opt->string = tok;
--
2.14.4