gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10481 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r10481 - gnunet/src/testing
Date: Thu, 4 Mar 2010 10:38:51 +0100

Author: grothoff
Date: 2010-03-04 10:38:51 +0100 (Thu, 04 Mar 2010)
New Revision: 10481

Modified:
   gnunet/src/testing/testing_group.c
Log:
fix

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2010-03-04 09:22:01 UTC (rev 10480)
+++ gnunet/src/testing/testing_group.c  2010-03-04 09:38:51 UTC (rev 10481)
@@ -612,13 +612,22 @@
   int connect_attempts;
   double probability;
   char *p_string;
+
+  probability = 0.5; /* FIXME: default percentage? */
+  if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg,
+                                                        "TESTING",
+                                                        "PROBABILITY",
+                                                        &p_string))
+    {
+      if (sscanf(p_string, "%lf", &probability) != 1)
+       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                   _("Invalid value `%s' for option `%s' in section `%s': 
expected float\n"),
+                   p_string,
+                   "PROBABILITY",
+                   "TESTING");
+      GNUNET_free (p_string);
+    }
   connect_attempts = 0;
-
-  GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PROBABILITY", 
&p_string);
-  if ((p_string == NULL) || (sscanf(p_string, "%lf", &probability) != 1))
-    probability = 0.5; /* FIXME: default probability? */
-
-  GNUNET_free_non_null (p_string);
   for (outer_count = 0; outer_count < pg->total - 1; outer_count++)
     {
       for (inner_count = outer_count + 1; inner_count < pg->total;
@@ -1044,6 +1053,7 @@
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                   _("No topology specified, was one intended?\n"));
+      return GNUNET_SYSERR;
     }
 
   return num_connections;





reply via email to

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