X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fconfigurator%2Fconfigurator.c;h=75c59f86db947263b2a0aa190d8119cfee3934b4;hp=daa90ee3be8ff2811653ef52d51aebe327e9ce03;hb=c455d55526c0f15a8b54ecc7bbaf282b01c48ad0;hpb=f3b3bedfb23096f050cfb6142a66c1687ea53b9b diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index daa90ee3..75c59f86 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -202,8 +202,9 @@ static struct test tests[] = { " return sizeof(off_t) == 8 ? 0 : 1;\n" "}\n" }, { "HAVE_FOR_LOOP_DECLARATION", INSIDE_MAIN, NULL, NULL, - "for (int i = 0; i < argc; i++) { return 0; };\n" - "return 1;" }, + "int ret = 1;\n" + "for (int i = 0; i < argc; i++) { ret = 0; };\n" + "return ret;" }, { "HAVE_FLEXIBLE_ARRAY_MEMBER", OUTSIDE_MAIN, NULL, NULL, "struct foo { unsigned int x; int arr[]; };" }, { "HAVE_GETPAGESIZE", DEFINES_FUNC, NULL, NULL, @@ -489,7 +490,7 @@ static bool run_test(const char *cmd, struct test *test) 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);