]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: add/cleanup initialisers
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 3 Mar 2015 08:07:25 +0000 (09:07 +0100)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 7 Jun 2016 12:51:46 +0000 (08:51 -0400)
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 <equinox@opensourcerouting.org>
lib/command.c
ospfd/ospf_spf.c
ripngd/ripngd.c

index 17e0f8d3b9702773314931a375523a28f9ae0acc..958d0eb244876dd23e5ca42f1ab3dbcf0e97e32c 100644 (file)
@@ -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;
 
index 9f6c6f471b027eb61e4674411ed8b794933d0def..5f8ef6f993ce162f1c58c1a43ef172be34e5ea1b 100644 (file)
@@ -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
index 13884ff3b333a3667238183fcf9723d893eb580e..e026d4748eae3727a9e9fce205c69b2106f54cea 100644 (file)
@@ -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));