[pisa-src] r1195 - trunk/libpisa/iw.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 15 Oct 2009 19:15:52 +0200

Author: tjansen
Date: Thu Oct 15 19:15:52 2009
New Revision: 1195

Log:
Fixed warning about uninitialized variable:

iw.c: In function ‘pisa_get_default_gateway’:
iw.c:295: warning: ‘snet_mask’ may be used uninitialized in this function

Modified:
   trunk/libpisa/iw.c

Modified: trunk/libpisa/iw.c
==============================================================================
--- trunk/libpisa/iw.c  Thu Oct 15 19:08:38 2009        (r1194)
+++ trunk/libpisa/iw.c  Thu Oct 15 19:15:52 2009        (r1195)
@@ -291,6 +291,7 @@
                /* Fetch and resolve the gateway address. */
                (void) inet_getsock(gate_addr, &snet_gateway);
 
+               memset(&snet_mask, 0, sizeof(snet_mask));
                sin_netmask = (struct sockaddr_in *)&snet_mask;
                strcpy(net_addr, inet_sprintmask(&snet_target, 
                                         (numeric | 0x8000 | (iflags & 
RTF_HOST? 0x4000: 0)),

Other related posts:

  • » [pisa-src] r1195 - trunk/libpisa/iw.c - Thomas Jansen