[pisa-src] r1458 - trunk/pairing/send.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Fri, 30 Oct 2009 12:30:29 +0100

Author: tjansen
Date: Fri Oct 30 12:30:28 2009
New Revision: 1458

Log:
Fix -Wcast-qual warning:

send.c: In function ‘parse_options’:
send.c:323: warning: cast discards qualifiers from pointer target type

Modified:
   trunk/pairing/send.c

Modified: trunk/pairing/send.c
==============================================================================
--- trunk/pairing/send.c        Fri Oct 30 12:27:05 2009        (r1457)
+++ trunk/pairing/send.c        Fri Oct 30 12:30:28 2009        (r1458)
@@ -162,7 +162,7 @@
        int pwd_given = 0;
        int ipv6_given = 0;
        int request_type_given = 0;
-       const char *temp = malloc(INET6_ADDRSTRLEN*sizeof(char));
+       char *temp = malloc(INET6_ADDRSTRLEN*sizeof(char));
        int sw;
 
        assert(password != NULL);
@@ -277,7 +277,7 @@
                        // Look up the HIT
                        strcpy(path, nickname);         // Construct the path
                        strcat(path, ".hit");
-                       success = config_lookup_string(&cfg, path, &temp);
+                       success = config_lookup_string(&cfg, path, (const char 
**)&temp);
                        if (success != CONFIG_TRUE || temp == NULL)
                        {
                                DEBUG("No HIT found for relay %s.", nickname);
@@ -289,7 +289,7 @@
                        // Look up the IPv6 address
                        strcpy(path, nickname);         // Construct the path
                        strcat(path, ".ipv6_addr");
-                       success = config_lookup_string(&cfg, path, &temp);
+                       success = config_lookup_string(&cfg, path, (const char 
**)&temp);
                        if (success != CONFIG_TRUE || temp == NULL)
                        {
                                DEBUG("No IPv6 address found for relay %s.", 
nickname);
@@ -320,7 +320,7 @@
                                        return 0;
                        USER_MSG("No IPv6 address given (use -i). Using default 
address: %s", ipv6_addr);
                }
-               free((char*)temp);
+               free(temp);
        }
 
        if (!request_type_given)

Other related posts:

  • » [pisa-src] r1458 - trunk/pairing/send.c - Thomas Jansen