Browse Source

Restore c89 in 0.2.5

Nick Mathewson 9 years ago
parent
commit
64bfc2930a
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/or/control.c

+ 5 - 2
src/or/control.c

@@ -4175,12 +4175,12 @@ get_bw_samples(void)
   int i;
   int i;
   int idx = (next_measurement_idx + N_BW_EVENTS_TO_CACHE - n_measurements)
   int idx = (next_measurement_idx + N_BW_EVENTS_TO_CACHE - n_measurements)
     % N_BW_EVENTS_TO_CACHE;
     % N_BW_EVENTS_TO_CACHE;
-  tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE);
-
   smartlist_t *elements = smartlist_new();
   smartlist_t *elements = smartlist_new();
+  tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE);
 
 
   for (i = 0; i < n_measurements; ++i) {
   for (i = 0; i < n_measurements; ++i) {
     tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE);
     tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE);
+    {
     const struct cached_bw_event_s *bwe = &cached_bw_events[idx];
     const struct cached_bw_event_s *bwe = &cached_bw_events[idx];
 
 
     smartlist_add_asprintf(elements, "%u,%u",
     smartlist_add_asprintf(elements, "%u,%u",
@@ -4188,14 +4188,17 @@ get_bw_samples(void)
                            (unsigned)bwe->n_written);
                            (unsigned)bwe->n_written);
 
 
     idx = (idx + 1) % N_BW_EVENTS_TO_CACHE;
     idx = (idx + 1) % N_BW_EVENTS_TO_CACHE;
+    }
   }
   }
 
 
+  {
   char *result = smartlist_join_strings(elements, " ", 0, NULL);
   char *result = smartlist_join_strings(elements, " ", 0, NULL);
 
 
   SMARTLIST_FOREACH(elements, char *, cp, tor_free(cp));
   SMARTLIST_FOREACH(elements, char *, cp, tor_free(cp));
   smartlist_free(elements);
   smartlist_free(elements);
 
 
   return result;
   return result;
+  }
 }
 }
 
 
 /** Called when we are sending a log message to the controllers: suspend
 /** Called when we are sending a log message to the controllers: suspend