]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: Reapply strcmp.cocci
authorTim Duesterhus <tim@bastelstu.be>
Sat, 8 Oct 2022 10:33:19 +0000 (12:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Oct 2022 13:49:09 +0000 (15:49 +0200)
This reapplies strcmp.cocci across the whole src/ tree.

src/cfgparse-quic.c
src/flt_bwlim.c

index 5268e9adafebf860705c0b019e85d1d1536114a8..f6706f2e0d154dbde816d63ed5a783d008f51d39 100644 (file)
@@ -26,9 +26,9 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
                return ERR_ALERT | ERR_FATAL;
        }
 
-       if (!strcmp(args[cur_arg + 1], "newreno"))
+       if (strcmp(args[cur_arg + 1], "newreno") == 0)
            cc_algo = &quic_cc_algo_nr;
-       else if (!strcmp(args[cur_arg + 1], "cubic"))
+       else if (strcmp(args[cur_arg + 1], "cubic") == 0)
            cc_algo = &quic_cc_algo_cubic;
        else {
                memprintf(err, "'%s' : unknown control congestion algorithm", args[cur_arg]);
index e3d3c0dc09ce433a5956a66657a564623fb20055..203f91d370cfbc951e4c5472bb5e32ce8c8ec26d 100644 (file)
@@ -419,7 +419,7 @@ int check_bwlim_action(struct act_rule *rule, struct proxy *px, char **err)
                conf = NULL;
                if (fconf->id == bwlim_flt_id) {
                        conf = fconf->conf;
-                       if (!strcmp(rule->arg.act.p[0], conf->name))
+                       if (strcmp(rule->arg.act.p[0], conf->name) == 0)
                                break;
                }
        }
@@ -639,7 +639,7 @@ static int parse_bwlim_flt(char **args, int *cur_arg, struct proxy *px, struct f
                if (fc->id == bwlim_flt_id) {
                        struct bwlim_config *c = fc->conf;
 
-                       if (!strcmp(conf->name, c->name)) {
+                       if (strcmp(conf->name, c->name) == 0) {
                                memprintf(err, "bwlim filter '%s' already declared for proxy '%s'\n",
                                          conf->name, px->id);
                                goto error;