diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-03-09 13:22:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-03-09 13:22:58 -0400 |
commit | 64bfc2930ac0be3af669636c16f6f0bba715056f (patch) | |
tree | b789ebfc07c212ca1cf9a1c25cfbf67550565120 /src/or | |
parent | 448bd220928f337e60dd377e8a3bb814248f4a7a (diff) | |
download | tor-64bfc2930ac0be3af669636c16f6f0bba715056f.tar.gz tor-64bfc2930ac0be3af669636c16f6f0bba715056f.zip |
Restore c89 in 0.2.5
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/control.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c index fbd648de97..2ff1cc8442 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -4175,12 +4175,12 @@ get_bw_samples(void) int i; int idx = (next_measurement_idx + N_BW_EVENTS_TO_CACHE - n_measurements) % N_BW_EVENTS_TO_CACHE; - tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE); - smartlist_t *elements = smartlist_new(); + tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE); for (i = 0; i < n_measurements; ++i) { tor_assert(0 <= idx && idx < N_BW_EVENTS_TO_CACHE); + { const struct cached_bw_event_s *bwe = &cached_bw_events[idx]; smartlist_add_asprintf(elements, "%u,%u", @@ -4188,14 +4188,17 @@ get_bw_samples(void) (unsigned)bwe->n_written); idx = (idx + 1) % N_BW_EVENTS_TO_CACHE; + } } + { char *result = smartlist_join_strings(elements, " ", 0, NULL); SMARTLIST_FOREACH(elements, char *, cp, tor_free(cp)); smartlist_free(elements); return result; + } } /** Called when we are sending a log message to the controllers: suspend |