aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-18 09:49:17 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-18 09:49:17 +0000
commita447570036453ee2a5e3a3fda263aaf754b73021 (patch)
treefbff89008f99147d481e649e9ebe91a15dfeb56b /src/or/rephist.c
parentb885db033e917a7df6731827d5afba5fb806fc41 (diff)
downloadtor-a447570036453ee2a5e3a3fda263aaf754b73021.tar
tor-a447570036453ee2a5e3a3fda263aaf754b73021.tar.gz
stop taking strlen of an uninitialized buffer
we were (are?) printing garbage in the rephist stats svn:r2284
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index c94b19fa1..603077ce5 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -266,9 +266,10 @@ void rep_hist_dump_stats(time_t now, int severity)
or_history->n_conn_ok, or_history->n_conn_fail+or_history->n_conn_ok,
upt, upt+downt, uptime*100.0);
- if (!strmap_isempty(or_history->link_history_map)) {
+ if (!strmap_isempty(or_history->link_history_map))
strcpy(buffer, " Good extend attempts: ");
- }
+ else
+ *buffer = '\0';
len = strlen(buffer);
for (lhist_it = strmap_iter_init(or_history->link_history_map);
!strmap_iter_done(lhist_it);