bgpd: fix ecommunity_token initialiser
This pulls up ecommunity_token_unknown to be the first enum value (at
0), and uses that as initialiser to get rid of the uninitialised use
warning.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index 482e76b..04957d4 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -281,10 +281,10 @@
/* Extended Communities token enum. */
enum ecommunity_token
{
+ ecommunity_token_unknown = 0,
ecommunity_token_rt,
ecommunity_token_soo,
ecommunity_token_val,
- ecommunity_token_unknown
};
/* Get next Extended Communities token from the string. */
@@ -511,7 +511,7 @@
ecommunity_str2com (const char *str, int type, int keyword_included)
{
struct ecommunity *ecom = NULL;
- enum ecommunity_token token;
+ enum ecommunity_token token = ecommunity_token_unknown;
struct ecommunity_val eval;
int keyword = 0;