-misc fixes based on cppcheck
authorChristian Grothoff <christian@grothoff.org>
Wed, 25 Sep 2013 21:42:11 +0000 (21:42 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 25 Sep 2013 21:42:11 +0000 (21:42 +0000)
19 files changed:
src/exit/gnunet-helper-exit-windows.c
src/experimentation/gnunet-daemon-experimentation_nodes.c
src/experimentation/gnunet-daemon-experimentation_scheduler.c
src/fs/fs_test_lib.c
src/fs/gnunet-daemon-fsprofiler.c
src/integration-tests/connection_watchdog.c
src/mesh/mesh_api.c
src/mesh/mesh_api_enc.c
src/namestore/test_namestore_api_zone_iteration.c
src/namestore/test_namestore_api_zone_iteration_specific_zone.c
src/nat/gnunet-helper-nat-client-windows.c
src/nat/gnunet-helper-nat-server-windows.c
src/nse/gnunet-nse-profiler.c
src/regex/gnunet-regex-profiler.c
src/testing/testing.c
src/transport/gnunet-helper-transport-bluetooth.c
src/util/program.c
src/util/strings.c
src/vpn/gnunet-helper-vpn-windows.c

index eb7c4f435b9f74758983c992b8fd97ae2e2333c6..461494480fd95999880c995cd38b5540325f266b 100644 (file)
@@ -357,7 +357,7 @@ remove_address6 (const char *address)
    */
   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 @@ remove_address4 (const char *address)
    */
   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 @@ teardown_final:
       
   CloseHandle (tap_handle);
 }
+
+
 /**
  * Open VPN tunnel interface.
  *
@@ -1475,14 +1477,18 @@ main (int argc, char **argv)
   
   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;
     }
 
index a4da92d50e8d7449f4d8c8c477330b70fe26ab45..37b0eba45a21b8651c028c3289df1b779c419c3d 100644 (file)
@@ -260,17 +260,17 @@ remove_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @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 @@ size_t send_experimentation_request_cb (void *cls, size_t bufsize, void *buf)
     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 @@ size_t send_experimentation_request_cb (void *cls, size_t bufsize, void *buf)
  *
  * @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;
index 34142fabb9016d3498fc7872dc07d9cd5b5cf09b..aef97ee48059aa006e2083a6bcb13ca79c25ae16 100644 (file)
@@ -227,21 +227,20 @@ static void run_experiment_outbound (void *cls,const struct GNUNET_SCHEDULER_Tas
 void
 GED_scheduler_handle_start (struct Node *n, struct Experiment *e)
 {
-       struct ScheduledExperiment *se;
-
-       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);
+  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);
 }
 
+
 /**
  * Handle a START_ACK message from a remote node
  *
index 758220f5fd3fa8bbd8a156da0340764bd2d3f7f7..0fc36e7acbfa792c9186a98c011b0076c8cbc974 100644 (file)
@@ -217,10 +217,7 @@ publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   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 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   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);
 }
index 30a12755987bc6d83b0b6fa195ec478f1cc92bf9..a19fa1ef6d883e2098f1ff445d5c0b3802870f37 100644 (file)
@@ -186,7 +186,7 @@ parse_pattern (struct Pattern **head,
                      "(%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;
index e519f0f826891bba6f6384408d1701cd841b91fa..73c86d8e4267c7b99395792007b4c5140d292c79 100644 (file)
@@ -205,17 +205,18 @@ stats_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
 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 @@ check_lowlevel_connections (int port, int protocol)
   {
     /* 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);
index ade5a4111ad49c856406924b982d6695165736eb..135e1e8697ba5e45e29dc129303deed784dbdae0 100644 (file)
@@ -229,9 +229,9 @@ struct GNUNET_MESH_Handle
  */
 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 @@ struct GNUNET_MESH_Peer
 
   /**
    * 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 @@ destroy_tunnel (struct GNUNET_MESH_Tunnel *t, int call_cleaner)
   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 @@ process_incoming_data (struct GNUNET_MESH_Handle *h,
 
   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++)
index da972c72aaebcb212659a213c23ae69c9ecdd4bc..38c82244cafb94bd24795a8755b9a3a147bacef9 100644 (file)
@@ -226,6 +226,7 @@ struct GNUNET_MESH_Peer
 
   /**
    * Flag indicating whether service has informed about its connection
+   * FIXME-BART: is this flag used? Seems dead right now...
    */
   int connected;
 
index ae79fe09caa944c84faa671537dbc0a1112ad934..dbe701fd88effade6ece6a604e28cf6c072ced62 100644 (file)
@@ -354,26 +354,26 @@ empty_zone_proc (void *cls,
   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;
index 299a8bbd85c6fedab0dc3464c1fa7ac3db435328..2b96d501e434f84eb5aba8516d7a98eed250ed6a 100644 (file)
@@ -342,7 +342,7 @@ empty_zone_proc (void *cls,
     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"));
index b28b285840e77040f3748c063bd7dd5fa0c665a8..9121e794334d9b48e767a7f8fcba5d642f6beffe 100644 (file)
@@ -471,7 +471,9 @@ main (int argc, char *const *argv)
   
   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 @@ main (int argc, char *const *argv)
   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 ()))
index fb564a188efff748fffee5f70528cfc00ab2105c..7962e307180d5d5a75504382ad99959ac3874eed 100644 (file)
@@ -533,12 +533,15 @@ main (int argc, char *const *argv)
   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)
   {
index e03da6d6eedff17585fb0bb502f69eb27e24c2ff..fa0b97440f764bdc0e76d6f02cb07acd83d0b51c 100644 (file)
@@ -83,39 +83,6 @@ struct NSEPeer
 };
 
 
-/**
- * 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
  */
@@ -413,16 +380,18 @@ nse_disconnect_adapter (void *cls,
 /**
  * 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;
index dffa64d7a8a58dadd58334c47c9c16a84de92b07..3430193472717a8e838eee4bfce3036cbf3f32f1 100644 (file)
@@ -1328,7 +1328,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     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 @@ run (void *cls, char *const *args, const char *cfgfile,
     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 @@ run (void *cls, char *const *args, const char *cfgfile,
   /* 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",
index 8f32d2409b03481bb71fa7646d5360a56fdbfe20..8502809f3a8f7c6edffb91b84b814281bb7f168d 100644 (file)
@@ -687,7 +687,7 @@ GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
  * 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 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
          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),
index d46b818a6b054c250d64fbea2d85c34a7fc03f75..43eccf0aa8383f17dab2cd2af758978472144b10 100644 (file)
@@ -1960,8 +1960,10 @@ main (int argc, char *argv[])
           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 @@ main (int argc, char *argv[])
     WSACleanup();
   #endif
   return 1;                     /* we never exit 'normally' */
-}
\ No newline at end of file
+}
index 9d2e0a40d8bd93ccb651aadda83e7cd6b6327035..16a2f508685ca4b071f21eeca8d6c0c15f43a2e5 100644 (file)
@@ -146,7 +146,9 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
                     int run_without_scheduler)
 {
   struct CommandContext cc;
+#if ENABLE_NLS
   char *path;
+#endif
   char *loglev;
   char *logfile;
   int ret;
index da02a9c4f018b98fac8224ca17735f9dc592ba9e..6380ea5ec217b4e6145c98a3bb95b6b9db1ab03b 100644 (file)
@@ -1275,7 +1275,7 @@ GNUNET_STRINGS_get_utf8_args (int argc, char *const *argv, int *u8argc, char *co
     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++)
index 0d31ee3996cbda41809b902f24de1dedafb22b06..15dc5a667c44f4d006a6cac5b63c38bf5e00f7dc 100644 (file)
@@ -357,7 +357,7 @@ remove_address6 (const char *address)
    */
   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 @@ remove_address6 (const char *address)
 
   /* 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 @@ set_address4 (const char *address, const char *mask)
 
   /* 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 @@ remove_address4 (const char *address)
    */
   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 @@ main (int argc, char **argv)
   
   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;
     }