[pisa-src] r1186 - trunk/libpisa/util.c

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 15 Oct 2009 17:44:47 +0200

Author: biurrun
Date: Thu Oct 15 17:44:47 2009
New Revision: 1186

Log:
Initialize some pointers to NULL, fixes the warnings:
util.c:969: warning: ‘addr_ptr’ may be used uninitialized in this function
util.c:969: warning: ‘alias’ may be used uninitialized in this function
util.c:969: warning: ‘hostname’ may be used uninitialized in this function

Modified:
   trunk/libpisa/util.c

Modified: trunk/libpisa/util.c
==============================================================================
--- trunk/libpisa/util.c        Thu Oct 15 17:32:48 2009        (r1185)
+++ trunk/libpisa/util.c        Thu Oct 15 17:44:47 2009        (r1186)
@@ -966,7 +966,7 @@
        int err = 0, lineno = 0;
        struct in_addr in_addr;
        struct pisa_hosts_file_line entry;
-       char *hostname, *alias, *addr_ptr;
+       char *hostname = NULL, *alias = NULL, *addr_ptr = NULL;
 
        memset(line, 0, sizeof(line));
 
@@ -1027,7 +1027,6 @@
 
                /* The list contains hosts line in reverse order. Let's sort 
it. */
                if (len == 2) {
-                       alias = NULL;
                        hostname = getitem(&mylist, 0);
                        addr_ptr = getitem(&mylist, 1);
                } else if (len == 3) {

Other related posts:

  • » [pisa-src] r1186 - trunk/libpisa/util.c - Diego Biurrun