diff options
| author | Tim Duesterhus <tim@bastelstu.be> | 2021-10-16 17:48:15 +0200 |
|---|---|---|
| committer | Willy Tarreau <w@1wt.eu> | 2021-10-18 07:17:04 +0200 |
| commit | c5aa113d805aa31a59e3a26f5f656b1fa0d526d0 (patch) | |
| tree | 18482ca2bda85aba287b481d8dba5a713489c5b3 | |
| parent | bce9108a1fd8b0afcc08a086796912c79f7de344 (diff) | |
| download | haproxy-c5aa113d805aa31a59e3a26f5f656b1fa0d526d0.tar.gz | |
CLEANUP: Apply strcmp.cocci
This fixes the use of the various *cmp functions to use != 0 or == 0.
| -rw-r--r-- | src/cfgparse.c | 2 | ||||
| -rw-r--r-- | src/cli.c | 4 | ||||
| -rw-r--r-- | src/server.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/cfgparse.c b/src/cfgparse.c index f013928f6..892170284 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1536,7 +1536,7 @@ static void check_section_position(char *section_name, const char *file, int linenum, int *non_global_parsed) { - if (!strcmp(section_name, "global")) { + if (strcmp(section_name, "global") == 0) { if (*non_global_parsed == 1) _ha_diag_warning("parsing [%s:%d] : global section detected after a non-global one, the prevalence of their statements is unspecified\n", file, linenum); } @@ -1714,11 +1714,11 @@ static int cli_parse_expert_experimental_mode(char **args, char *payload, struct if (!cli_has_level(appctx, ACCESS_LVL_ADMIN)) return 1; - if (!strcmp(args[0], "expert-mode")) { + if (strcmp(args[0], "expert-mode") == 0) { level = ACCESS_EXPERT; level_str = "expert-mode"; } - else if (!strcmp(args[0], "experimental-mode")) { + else if (strcmp(args[0], "experimental-mode") == 0) { level = ACCESS_EXPERIMENTAL; level_str = "experimental-mode"; } diff --git a/src/server.c b/src/server.c index b8908cefa..15c4d0536 100644 --- a/src/server.c +++ b/src/server.c @@ -4681,7 +4681,7 @@ static int cli_parse_add_server(char **args, char *payload, struct appctx *appct while (1) { /* check for duplicate server */ - if (!strcmp(srv->id, next->id)) { + if (strcmp(srv->id, next->id) == 0) { ha_alert("Already exists a server with the same name in backend.\n"); goto out; } |
