]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: sample: avoid build warning in sample.c
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Apr 2018 08:33:28 +0000 (10:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Apr 2018 08:33:28 +0000 (10:33 +0200)
Recent commit 9631a28 ("MEDIUM: sample: Extend functionality for field/word
converters") introduced this minor build warning that this patch addresses :

 src/sample.c: In function 'sample_conv_word':
 src/sample.c:2108:8: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
 src/sample.c:2137:8: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]

No backport is needed.

src/sample.c

index 154beb5cd3b724ac071bce6527530821420ccc7d..b1c01484fbc680ec68beacb858973c2ad5a79fd1 100644 (file)
@@ -2105,11 +2105,12 @@ static int sample_conv_word(const struct arg *arg_p, struct sample *smp, void *p
                                }
                        }
                        else if (issep) {
-                               if (word == arg_p[0].data.sint)
+                               if (word == arg_p[0].data.sint) {
                                        if (count == 1)
                                                goto found;
                                        else if (count > 1)
                                                count--;
+                               }
                                inword = 0;
                        }
                        start--;
@@ -2134,11 +2135,12 @@ static int sample_conv_word(const struct arg *arg_p, struct sample *smp, void *p
                                }
                        }
                        else if (issep) {
-                               if (word == arg_p[0].data.sint)
+                               if (word == arg_p[0].data.sint) {
                                        if (count == 1)
                                                goto found;
                                        else if (count > 1)
                                                count--;
+                               }
                                inword = 0;
                        }
                        end++;