]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: peers: fix a build warning about an incorrect intiialization
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Jun 2019 14:40:43 +0000 (16:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Jun 2019 14:42:14 +0000 (16:42 +0200)
Just got this one :
src/peers.c:528:13: warning: missing braces around initializer [-Wmissing-braces]
src/peers.c:528:13: warning: (near initialization for 'cde.key') [-Wmissing-braces]

Indeed, this struct contains two structs so scalar zero is not a valid
value for the first field. Let's just leave it as an empty struct since
it was the purpose.

src/peers.c

index 159f7cedfe2d200f274fc8b4b3ea519b15b75f4e..eebf48a28c382dfdc2810fd7571eead8551c7cea 100644 (file)
@@ -525,7 +525,7 @@ static int peer_prepare_updatemsg(char *msg, size_t size, struct peer_prep_param
                                case STD_T_DICT: {
                                        struct dict_entry *de;
                                        struct dcache_tx_entry *cached_de;
-                                       struct dcache_tx_entry cde = {0};
+                                       struct dcache_tx_entry cde = { };
                                        char *beg, *end;
                                        size_t value_len, data_len;
                                        struct dcache *dc;