gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29572 - in gnunet/src: exit experimentation fs integration


From: gnunet
Subject: [GNUnet-SVN] r29572 - in gnunet/src: exit experimentation fs integration-tests mesh namestore nat nse regex testing transport util vpn
Date: Wed, 25 Sep 2013 23:42:12 +0200

Author: grothoff
Date: 2013-09-25 23:42:11 +0200 (Wed, 25 Sep 2013)
New Revision: 29572

Modified:
   gnunet/src/exit/gnunet-helper-exit-windows.c
   gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
   gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
   gnunet/src/fs/fs_test_lib.c
   gnunet/src/fs/gnunet-daemon-fsprofiler.c
   gnunet/src/integration-tests/connection_watchdog.c
   gnunet/src/mesh/mesh_api.c
   gnunet/src/mesh/mesh_api_enc.c
   gnunet/src/namestore/test_namestore_api_zone_iteration.c
   gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
   gnunet/src/nat/gnunet-helper-nat-client-windows.c
   gnunet/src/nat/gnunet-helper-nat-server-windows.c
   gnunet/src/nse/gnunet-nse-profiler.c
   gnunet/src/regex/gnunet-regex-profiler.c
   gnunet/src/testing/testing.c
   gnunet/src/transport/gnunet-helper-transport-bluetooth.c
   gnunet/src/util/program.c
   gnunet/src/util/strings.c
   gnunet/src/vpn/gnunet-helper-vpn-windows.c
Log:
-misc fixes based on cppcheck

Modified: gnunet/src/exit/gnunet-helper-exit-windows.c
===================================================================
--- gnunet/src/exit/gnunet-helper-exit-windows.c        2013-09-25 18:31:58 UTC 
(rev 29571)
+++ gnunet/src/exit/gnunet-helper-exit-windows.c        2013-09-25 21:42:11 UTC 
(rev 29572)
@@ -357,7 +357,7 @@
    */
   snprintf (command, LINE_LEN,
             "netsh interface ipv6 delete address \"%s\" store=persistent",
-            device_visible_name, address);
+            device_visible_name);
   /*
    * Set the address
    */
@@ -432,7 +432,7 @@
    */
   snprintf (command, LINE_LEN,
             "netsh interface ipv4 delete address \"%s\" gateway=all 
store=persistent",
-            device_visible_name, address);
+            device_visible_name);
   /*
    * Set the address
    */
@@ -1450,6 +1450,8 @@
       
   CloseHandle (tap_handle);
 }
+
+
 /**
  * Open VPN tunnel interface.
  *
@@ -1475,14 +1477,18 @@
   
   if ( (1 < argc) && (0 != strcmp (argv[1], "-d"))){
       privilege_testing = TRUE;
-      fprintf (stderr, "DEBUG: Running binary in privilege testing mode.", 
argv[0]);
+      fprintf (stderr,
+              "%s",
+              "DEBUG: Running binary in privilege testing mode.");
       argv++;
       argc--;
     }
   
   if (6 != argc)
     {
-      fprintf (stderr, "FATAL: must supply 6 
arguments\nUsage:\ngnunet-helper-exit [-d] <if name prefix> <uplink-interface 
name> <address6 or \"-\"> <netbits6> <address4 or \"-\"> <netmask4>\n", 
argv[0]);
+      fprintf (stderr, 
+              "%s",
+              "FATAL: must supply 6 arguments\nUsage:\ngnunet-helper-exit [-d] 
<if name prefix> <uplink-interface name> <address6 or \"-\"> <netbits6> 
<address4 or \"-\"> <netmask4>\n");
       return 1;
     }
 

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-09-25 21:42:11 UTC (rev 29572)
@@ -260,17 +260,17 @@
  * @param buf the buffer to copy to
  * @return bytes passed
  */
-size_t send_experimentation_request_cb (void *cls, size_t bufsize, void *buf)
+static size_t 
+send_experimentation_request_cb (void *cls, size_t bufsize, void *buf)
 {
-       struct Node *n = cls;
-       struct Experimentation_Request msg;
-       size_t msg_size = sizeof (msg);
-       size_t ri_size = sizeof (struct Experimentation_Issuer) * 
GSE_my_issuer_count;
-       size_t total_size = msg_size + ri_size;
-
-       memset (buf, '\0', bufsize);
-       n->cth = NULL;
-  if (buf == NULL)
+  struct Node *n = cls;
+  struct Experimentation_Request msg;
+  size_t msg_size = sizeof (msg);
+  size_t ri_size = sizeof (struct Experimentation_Issuer) * 
GSE_my_issuer_count;
+  size_t total_size = msg_size + ri_size;
+       
+  n->cth = NULL;
+  if (NULL == buf)
   {
     /* client disconnected */
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client disconnected\n");
@@ -279,6 +279,7 @@
     GNUNET_SCHEDULER_add_now (&remove_request, n);
     return 0;
   }
+  memset (buf, '\0', bufsize);
   GNUNET_assert (bufsize >= total_size);
 
        msg.msg.size = htons (total_size);
@@ -299,7 +300,8 @@
  *
  * @param peer the peer to send to
  */
-static void send_experimentation_request (const struct GNUNET_PeerIdentity 
*peer)
+static void 
+send_experimentation_request (const struct GNUNET_PeerIdentity *peer)
 {
        struct Node *n;
        struct NodeComCtx *e_ctx;

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c        
2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c        
2013-09-25 21:42:11 UTC (rev 29572)
@@ -227,21 +227,20 @@
 void
 GED_scheduler_handle_start (struct Node *n, struct Experiment *e)
 {
-       struct ScheduledExperiment *se;
+  if ((NULL != find_experiment (waiting_in_head, waiting_in_tail, n, e, 
GNUNET_NO)) ||
+      (NULL != find_experiment (running_in_head, running_in_tail, n, e, 
GNUNET_NO)))
+  {
+    GNUNET_break_op (0);
+    return;
+  }
+  
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "Received %s message from peer %s for experiment `%s'\n",
+             "START", GNUNET_i2s (&n->id), e->name);
+  GED_scheduler_add (n, e, GNUNET_NO);
+}
 
-       if ((NULL != (se = find_experiment (waiting_in_head, waiting_in_tail, 
n, e, GNUNET_NO))) ||
-                (NULL != (se = find_experiment (running_in_head, 
running_in_tail, n, e, GNUNET_NO))))
-       {
-               GNUNET_break_op (0);
-               return;
-       }
 
-       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s message from peer %s 
for experiment `%s'\n",
-                       "START", GNUNET_i2s (&n->id), e->name);
-
-       GED_scheduler_add (n, e, GNUNET_NO);
-}
-
 /**
  * Handle a START_ACK message from a remote node
  *

Modified: gnunet/src/fs/fs_test_lib.c
===================================================================
--- gnunet/src/fs/fs_test_lib.c 2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/fs/fs_test_lib.c 2013-09-25 21:42:11 UTC (rev 29572)
@@ -217,10 +217,7 @@
   po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               "Timeout while trying to publish data\n");
-  if (NULL == po->fs)
-    GNUNET_TESTBED_operation_done (po->fs_op);
-  else
-    GNUNET_TESTBED_operation_done (po->fs_op);
+  GNUNET_TESTBED_operation_done (po->fs_op);
   GNUNET_FS_publish_stop (po->publish_context);
   po->publish_cont (po->publish_cont_cls, NULL, NULL);
   (void) GNUNET_DISK_directory_remove (po->publish_tmp_file);
@@ -492,10 +489,7 @@
   GNUNET_SCHEDULER_add_continuation (dop->download_cont,
                                      dop->download_cont_cls,
                                      GNUNET_SCHEDULER_REASON_TIMEOUT);
-  if (NULL == dop->fs)
-    GNUNET_TESTBED_operation_done (dop->fs_op);
-  else
-    GNUNET_TESTBED_operation_done (dop->fs_op);
+  GNUNET_TESTBED_operation_done (dop->fs_op);
   GNUNET_FS_uri_destroy (dop->uri);
   GNUNET_free (dop);
 }

Modified: gnunet/src/fs/gnunet-daemon-fsprofiler.c
===================================================================
--- gnunet/src/fs/gnunet-daemon-fsprofiler.c    2013-09-25 18:31:58 UTC (rev 
29571)
+++ gnunet/src/fs/gnunet-daemon-fsprofiler.c    2013-09-25 21:42:11 UTC (rev 
29572)
@@ -186,7 +186,7 @@
                      "(%llu,%llu,%llu)",
                      &x, &y, &t))
   {
-    p = GNUNET_malloc (sizeof (struct Pattern));
+    p = GNUNET_new (struct Pattern);
     p->x = x;
     p->y = y;
     p->delay.rel_value_us = (uint64_t) t;

Modified: gnunet/src/integration-tests/connection_watchdog.c
===================================================================
--- gnunet/src/integration-tests/connection_watchdog.c  2013-09-25 18:31:58 UTC 
(rev 29571)
+++ gnunet/src/integration-tests/connection_watchdog.c  2013-09-25 21:42:11 UTC 
(rev 29572)
@@ -205,17 +205,18 @@
 static int
 check_lowlevel_connections (int port, int protocol)
 {
+#ifdef MINGW
+  /* not supported */
+  return count;
+#else
   FILE *f;
   char * cmdline;
   char * proto;
   char line[1024];
   int count = -1;
-#ifdef MINGW
-  /* not supported */
-  return count;
-#else
 
-  switch (protocol) {
+  switch (protocol) 
+  {
     case tcp:
       proto = "-t";
       break;
@@ -252,11 +253,12 @@
   {
     /* read */
     //printf ("%s", line);
-    count ++;
+    count++;
   }
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%i TCP connections established with 
port %u\n",
-       count, port);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "%i TCP connections established with port %u\n",
+             count, port);
 
   pclose (f);
   GNUNET_free (cmdline);

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/mesh/mesh_api.c  2013-09-25 21:42:11 UTC (rev 29572)
@@ -229,9 +229,9 @@
  */
 struct GNUNET_MESH_Peer
 {
-    /**
-     * ID of the peer in short form
-     */
+  /**
+   * ID of the peer in short form
+   */
   GNUNET_PEER_Id id;
 
   /**
@@ -241,6 +241,7 @@
 
   /**
    * Flag indicating whether service has informed about its connection
+   * FIXME-BART: is this flag used? Seems dead right now...
    */
   int connected;
 
@@ -478,13 +479,14 @@
   struct GNUNET_MESH_TransmitHandle *th;
   struct GNUNET_MESH_TransmitHandle *next;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "destroy_tunnel %X\n", t->tid);
-
   if (NULL == t)
   {
     GNUNET_break (0);
     return;
   }
+  LOG (GNUNET_ERROR_TYPE_DEBUG, 
+       "destroy_tunnel %X\n", 
+       t->tid);
   h = t->mesh;
 
   GNUNET_CONTAINER_DLL_remove (h->tunnels_head, h->tunnels_tail, t);
@@ -904,15 +906,17 @@
 
   t = retrieve_tunnel (h, ntohl (dmsg->tid));
   payload = (struct GNUNET_MessageHeader *) &dmsg[1];
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "  %s data on tunnel %s [%X]\n",
-       t->tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV ? "fwd" : "bck",
-       GNUNET_i2s (GNUNET_PEER_resolve2(t->peer)), ntohl (dmsg->tid));
   if (NULL == t)
   {
     /* Tunnel was ignored/destroyed, probably service didn't get it yet */
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  ignored!\n");
     return;
   }
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "  %s data on tunnel %s [%X]\n",
+       t->tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV ? "fwd" : "bck",
+       GNUNET_i2s (GNUNET_PEER_resolve2(t->peer)), 
+       ntohl (dmsg->tid));
   type = ntohs (payload->type);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "  payload type %u\n", type);
   for (i = 0; i < h->n_handlers; i++)

Modified: gnunet/src/mesh/mesh_api_enc.c
===================================================================
--- gnunet/src/mesh/mesh_api_enc.c      2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/mesh/mesh_api_enc.c      2013-09-25 21:42:11 UTC (rev 29572)
@@ -226,6 +226,7 @@
 
   /**
    * Flag indicating whether service has informed about its connection
+   * FIXME-BART: is this flag used? Seems dead right now...
    */
   int connected;
 

Modified: gnunet/src/namestore/test_namestore_api_zone_iteration.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration.c    2013-09-25 
18:31:58 UTC (rev 29571)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration.c    2013-09-25 
21:42:11 UTC (rev 29572)
@@ -354,26 +354,26 @@
   char *hostkey_file;
 
   GNUNET_assert (nsh == cls);
-       if (NULL != zone)
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                       _("Expected empty zone but received zone private 
key\n"));
+  if (NULL != zone)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               _("Expected empty zone but received zone private key\n"));
     GNUNET_break (0);
     if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
-       GNUNET_SCHEDULER_cancel (endbadly_task);
+      GNUNET_SCHEDULER_cancel (endbadly_task);
     endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
     return;
-       }
-       if ((NULL != label) || (NULL != rd) || (0 != rd))
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                       _("Expected no zone content but received data\n"));
+  }
+  if ((NULL != label) || (NULL != rd) || (0 != rd_count))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               _("Expected no zone content but received data\n"));
     GNUNET_break (0);
     if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
-       GNUNET_SCHEDULER_cancel (endbadly_task);
+      GNUNET_SCHEDULER_cancel (endbadly_task);
     endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
     return;
-       }
+  }
 
 
   zi = NULL;

Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c      
2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c      
2013-09-25 21:42:11 UTC (rev 29572)
@@ -342,7 +342,7 @@
     endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
     return;
        }
-       if ((NULL != label) || (NULL != rd) || (0 != rd))
+       if ((NULL != label) || (NULL != rd) || (0 != rd_count))
        {
          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                        _("Expected no zone content but received data\n"));

Modified: gnunet/src/nat/gnunet-helper-nat-client-windows.c
===================================================================
--- gnunet/src/nat/gnunet-helper-nat-client-windows.c   2013-09-25 18:31:58 UTC 
(rev 29571)
+++ gnunet/src/nat/gnunet-helper-nat-client-windows.c   2013-09-25 21:42:11 UTC 
(rev 29572)
@@ -471,7 +471,9 @@
   
   if (argc > 1 && 0 != strcmp (argv[1], "-d")){
       privilege_testing = TRUE;
-      fprintf (stderr, "DEBUG: Running binary in privilege testing mode.", 
argv[0]);
+      fprintf (stderr, 
+              "%s",
+              "DEBUG: Running binary in privilege testing mode.");
       argv++;
       argc--;
     }
@@ -479,30 +481,39 @@
   if (argc != 4)
   {
     fprintf (stderr,
-             "This program must be started with our IP, the targets external 
IP, and our port as arguments.\n");
+             "%s",
+            "This program must be started with our IP, the targets external 
IP, and our port as arguments.\n");
     return 1;
   }
   if ((1 != inet_pton (AF_INET, argv[1], &external)) ||
       (1 != inet_pton (AF_INET, argv[2], &target)))
   {
-    fprintf (stderr, "Error parsing IPv4 address: %s\n", strerror (errno));
+    fprintf (stderr,
+            "Error parsing IPv4 address: %s\n", 
+            strerror (errno));
     return 1;
   }
   if ((1 != sscanf (argv[3], "%u", &p)) || (0 == p) || (0xFFFF < p))
   {
-    fprintf (stderr, "Error parsing port value `%s'\n", argv[3]);
+    fprintf (stderr, 
+            "Error parsing port value `%s'\n", 
+            argv[3]);
     return 1;
   }
   port = (uint16_t) p;
 
   if (0 != WSAStartup (MAKEWORD (2, 1), &wsaData))
   {
-    fprintf (stderr, "Failed to find Winsock 2.1 or better.\n");
+    fprintf (stderr, 
+            "%s",
+            "Failed to find Winsock 2.1 or better.\n");
     return 2;
   }
   if (1 != inet_pton (AF_INET, DUMMY_IP, &dummy))
   {
-    fprintf (stderr, "Internal error converting dummy IP to binary.\n");
+    fprintf (stderr, 
+            "%s",
+            "Internal error converting dummy IP to binary.\n");
     return 2;
   }
   if (-1 == (rawsock = make_raw_socket ()))

Modified: gnunet/src/nat/gnunet-helper-nat-server-windows.c
===================================================================
--- gnunet/src/nat/gnunet-helper-nat-server-windows.c   2013-09-25 18:31:58 UTC 
(rev 29571)
+++ gnunet/src/nat/gnunet-helper-nat-server-windows.c   2013-09-25 21:42:11 UTC 
(rev 29572)
@@ -533,12 +533,15 @@
   WSADATA wsaData;
   unsigned int alt = 0;
 
-  if (argc > 1 && 0 != strcmp (argv[1], "-d")){
-      privilege_testing = TRUE;
-      fprintf (stderr, "DEBUG: Running binary in privilege testing mode.", 
argv[0]);
-      argv++;
-      argc--;
-    }
+  if ( (argc > 1) && (0 != strcmp (argv[1], "-d"))) 
+  {
+    privilege_testing = TRUE;
+    fprintf (stderr,
+            "%s",
+            "DEBUG: Running binary in privilege testing mode.");
+    argv++;
+    argc--;
+  }
   
   if (2 != argc)
   {

Modified: gnunet/src/nse/gnunet-nse-profiler.c
===================================================================
--- gnunet/src/nse/gnunet-nse-profiler.c        2013-09-25 18:31:58 UTC (rev 
29571)
+++ gnunet/src/nse/gnunet-nse-profiler.c        2013-09-25 21:42:11 UTC (rev 
29572)
@@ -84,39 +84,6 @@
 
 
 /**
- * Context for the stats task?
- */
-struct StatsContext
-{
-
-  /**
-   * How many messages have peers received during the test.
-   */
-  unsigned long long total_nse_received_messages;
-
-  /**
-   * How many messages have peers send during the test (should be == received).
-   */
-  unsigned long long total_nse_transmitted_messages;
-
-  /**
-   * How many messages have travelled an edge in both directions.
-   */
-  unsigned long long total_nse_cross;
-
-  /**
-   * How many extra messages per edge (corrections) have been received.
-   */
-  unsigned long long total_nse_extra;
-
-  /**
-   * How many messages have been discarded.
-   */
-  unsigned long long total_discarded;
-};
-
-
-/**
  * Operation map entry
  */
 struct OpListEntry
@@ -413,16 +380,18 @@
 /**
  * Callback function to process statistic values.
  *
- * @param cls struct StatsContext
+ * @param cls `struct NSEPeer`
  * @param subsystem name of subsystem that created the statistic
  * @param name the name of the datum
  * @param value the current value
- * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
- * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if 
not
+ * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
  */
 static int
-stat_iterator (void *cls, const char *subsystem, const char *name,
-                     uint64_t value, int is_persistent)
+stat_iterator (void *cls,
+              const char *subsystem, 
+              const char *name,
+              uint64_t value, int is_persistent)
 {
   char *output_buffer;
   struct GNUNET_TIME_Absolute now;

Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c    2013-09-25 18:31:58 UTC (rev 
29571)
+++ gnunet/src/regex/gnunet-regex-profiler.c    2013-09-25 21:42:11 UTC (rev 
29572)
@@ -1328,7 +1328,7 @@
     shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
     return;
   }
-  if (-1 == (num_peers = GNUNET_DISK_directory_scan (policy_dir, NULL, NULL)))
+  if (0 >= (int) (num_peers = GNUNET_DISK_directory_scan (policy_dir, NULL, 
NULL)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("No files found in `%s'\n"),
@@ -1357,7 +1357,7 @@
     shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
     return;
   }
-  if (0 >= num_peers || NULL == search_strings)
+  if ( (0 == num_peers) || (NULL == search_strings))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Error loading search strings. Exiting.\n"));
@@ -1388,9 +1388,7 @@
   /* Initialize peers */
   peers = GNUNET_malloc (sizeof (struct RegexPeer) * num_peers);
   for (i = 0; i < num_peers; i++)
-  {
     peers[i].id = i;
-  }
 
   GNUNET_CONFIGURATION_set_value_number (cfg,
                                          "TESTBED", "OVERLAY_RANDOM_LINKS",

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/testing/testing.c        2013-09-25 21:42:11 UTC (rev 29572)
@@ -687,7 +687,7 @@
  * GNUnet source code.
  *
  * This is primarily a helper function used internally
- * by 'GNUNET_TESTING_peer_configure'.
+ * by #GNUNET_TESTING_peer_configure.
  *
  * @param system the testing system handle
  * @param key_number desired pre-created hostkey to obtain
@@ -716,12 +716,6 @@
          system->hostkeys_data +
          (key_number * GNUNET_TESTING_HOSTKEYFILESIZE),
          GNUNET_TESTING_HOSTKEYFILESIZE);
-  if (NULL == private_key)
-  {
-    LOG (GNUNET_ERROR_TYPE_ERROR,
-         _("Error while decoding key %u\n"), key_number);
-    return NULL;
-  }
   GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key, &public_key);
   GNUNET_CRYPTO_hash (&public_key,
                       sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),

Modified: gnunet/src/transport/gnunet-helper-transport-bluetooth.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-bluetooth.c    2013-09-25 
18:31:58 UTC (rev 29571)
+++ gnunet/src/transport/gnunet-helper-transport-bluetooth.c    2013-09-25 
21:42:11 UTC (rev 29572)
@@ -1960,8 +1960,10 @@
           read (i, readbuf, sizeof (readbuf));
               if (0 > ret)
               {
-                fprintf (stderr, "Read error from STDIN: %s\n", strerror 
(errno));
-                break; break;
+                fprintf (stderr,
+                        "Read error from STDIN: %s\n",
+                        strerror (errno));
+                break; 
               }
               if (0 == ret)
               {
@@ -2443,4 +2445,4 @@
     WSACleanup();
   #endif
   return 1;                     /* we never exit 'normally' */
-}
\ No newline at end of file
+}

Modified: gnunet/src/util/program.c
===================================================================
--- gnunet/src/util/program.c   2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/util/program.c   2013-09-25 21:42:11 UTC (rev 29572)
@@ -146,7 +146,9 @@
                     int run_without_scheduler)
 {
   struct CommandContext cc;
+#if ENABLE_NLS
   char *path;
+#endif
   char *loglev;
   char *logfile;
   int ret;

Modified: gnunet/src/util/strings.c
===================================================================
--- gnunet/src/util/strings.c   2013-09-25 18:31:58 UTC (rev 29571)
+++ gnunet/src/util/strings.c   2013-09-25 21:42:11 UTC (rev 29572)
@@ -1275,7 +1275,7 @@
     size_t strl;
     /* Hopefully it will allocate us NUL-terminated strings... */
     split_u8argv[i] = (char *) u16_to_u8 (wargv[i], wcslen (wargv[i]) + 1, 
NULL, &strl);
-    if (split_u8argv == NULL)
+    if (NULL == split_u8argv[i])
     {
       int j;
       for (j = 0; j < i; j++)

Modified: gnunet/src/vpn/gnunet-helper-vpn-windows.c
===================================================================
--- gnunet/src/vpn/gnunet-helper-vpn-windows.c  2013-09-25 18:31:58 UTC (rev 
29571)
+++ gnunet/src/vpn/gnunet-helper-vpn-windows.c  2013-09-25 21:42:11 UTC (rev 
29572)
@@ -357,7 +357,7 @@
    */
   snprintf (command, LINE_LEN,
             "netsh interface ipv6 delete address \"%s\" store=persistent",
-            device_visible_name, address);
+            device_visible_name);
   /*
    * Set the address
    */
@@ -365,7 +365,9 @@
 
   /* Did it work?*/
   if (0 != ret)
-    fprintf (stderr, "FATAL: removing IPv6 address failed: %s\n", strerror 
(ret));
+    fprintf (stderr, 
+            "FATAL: removing IPv6 address failed: %s\n",
+            strerror (ret));
 }
 
 
@@ -408,7 +410,9 @@
 
   /* Did it work?*/
   if (0 != ret)
-    fprintf (stderr, "FATAL: Setting IPv4 address failed: %s\n", strerror 
(ret));
+    fprintf (stderr, 
+            "FATAL: Setting IPv4 address failed: %s\n", 
+            strerror (ret));
   return ret;
 }
 
@@ -431,7 +435,7 @@
    */
   snprintf (command, LINE_LEN,
             "netsh interface ipv4 delete address \"%s\" gateway=all 
store=persistent",
-            device_visible_name, address);
+            device_visible_name);
   /*
    * Set the address
    */
@@ -1471,14 +1475,18 @@
   
   if (argc > 1 && 0 != strcmp (argv[1], "-d")){
       privilege_testing = TRUE;
-      fprintf (stderr, "DEBUG: Running binary in privilege testing mode.", 
argv[0]);
+      fprintf (stderr, 
+              "%s",
+              "DEBUG: Running binary in privilege testing mode.");
       argv++;
       argc--;
     }
   
   if (6 != argc)
     {
-      fprintf (stderr, "FATAL: must supply 5 
arguments\nUsage:\ngnunet-helper-vpn [-d] <if name prefix> <address6 or \"-\"> 
<netbits6> <address4 or \"-\"> <netmask4>\n", argv[0]);
+      fprintf (stderr,
+              "%s",
+              "FATAL: must supply 5 arguments\nUsage:\ngnunet-helper-vpn [-d] 
<if name prefix> <address6 or \"-\"> <netbits6> <address4 or \"-\"> 
<netmask4>\n");
       return 1;
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]