From: David Lamparter Date: Tue, 3 Mar 2015 08:07:25 +0000 (+0100) Subject: *: add/cleanup initialisers X-Git-Tag: frr-2.0-rc1~600 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c5e0075f8b0ed11c81333bbe6970ebc9479e3a70;p=mirror_frr.git *: add/cleanup initialisers There were some (inconsequential) warnings about uninitialised use of variables. Also, in one case, sub-structs were mixed in initialisation, which doesn't quite work as intended. Signed-off-by: David Lamparter --- diff --git a/lib/command.c b/lib/command.c index 17e0f8d3b..958d0eb24 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1355,7 +1355,7 @@ cmd_matcher_match_multiple(struct cmd_matcher *matcher, enum match_type multiple_match; unsigned int multiple_index; const char *word; - const char *arg; + const char *arg = NULL; struct cmd_token *word_token; enum match_type word_match; diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 9f6c6f471..5f8ef6f99 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -590,8 +590,7 @@ ospf_nexthop_calculation (struct ospf_area *area, struct vertex *v, if (l->m[0].type == LSA_LINK_TYPE_POINTOPOINT) { - struct in_addr nexthop; - nexthop.s_addr = 0; + struct in_addr nexthop = { .s_addr = 0 }; /* If the destination is a router which connects to the calculating router via a Point-to-MultiPoint diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 13884ff3b..e026d4748 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -236,7 +236,7 @@ ripng_recv_packet (int sock, u_char *buf, int bufsize, struct msghdr msg; struct iovec iov; struct cmsghdr *cmsgptr; - struct in6_addr dst; + struct in6_addr dst = { .s6_addr = { 0 } }; memset(&dst, 0, sizeof(struct in6_addr));