]> git.ozlabs.org Git - ccan/commitdiff
configurator: Fix compiler warning with compare
authorKevin Locke <kevin@kevinlocke.name>
Fri, 23 Sep 2016 03:33:10 +0000 (21:33 -0600)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 27 Sep 2016 05:39:45 +0000 (15:39 +1000)
Visual Studio prints warning C4706 "assignment within conditional
expression" when there is an assignment without a comparison in a
conditional expression.  Therefore, to silence the warning, add an
explicit comparison.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
tools/configurator/configurator.c

index daa90ee3be8ff2811653ef52d51aebe327e9ce03..e9ff5ef13ec057763dee3140fba5c719a0cc5058 100644 (file)
@@ -489,7 +489,7 @@ static bool run_test(const char *cmd, struct test *test)
                char *dep;
 
                /* Space-separated dependencies, could be ! for inverse. */
                char *dep;
 
                /* Space-separated dependencies, could be ! for inverse. */
-               while ((len = strcspn(deps, " "))) {
+               while ((len = strcspn(deps, " ")) != 0) {
                        bool positive = true;
                        if (deps[len]) {
                                dep = strdup(deps);
                        bool positive = true;
                        if (deps[len]) {
                                dep = strdup(deps);