summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-06-10 19:06:48 +0000
committerNick Mathewson <nickm@torproject.org>2008-06-10 19:06:48 +0000
commit1ec5705445ed5ab7e5ea055314596fbbf656fa1e (patch)
treeeb92440fa22cd806242083b45d17c8d1578f87c9
parent8fa2e80257c2fbf75b62c1942c43ee80beac37ce (diff)
downloadtor-1ec5705445ed5ab7e5ea055314596fbbf656fa1e.tar.gz
tor-1ec5705445ed5ab7e5ea055314596fbbf656fa1e.zip
r16133@tombo: nickm | 2008-06-10 15:06:43 -0400
Pointers do not make good ints. svn:r15102
-rw-r--r--src/or/geoip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 49250a7648..b925e1f464 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -289,6 +289,8 @@ geoip_note_client_seen(geoip_client_action_t action,
/* DOCDOC */
while (current_request_period_starts + REQUEST_HIST_PERIOD >= now) {
+ if (!geoip_countries)
+ geoip_countries = smartlist_create();
SMARTLIST_FOREACH(geoip_countries, geoip_country_t *, c, {
memmove(&c->n_v2_ns_requests[0], &c->n_v2_ns_requests[1],
sizeof(uint32_t)*(REQUEST_HIST_LEN-1));
@@ -509,7 +511,7 @@ geoip_get_request_history(time_t now, geoip_client_action_t action)
char buf[32];
for (i=0; i < REQUEST_HIST_LEN; ++i)
tot += n[i];
- tor_snprintf(buf, sizeof(buf), "%s=%ld", c->countrycode, (long)n);
+ tor_snprintf(buf, sizeof(buf), "%s=%ld", c->countrycode, (long)tot);
smartlist_add(entries, tor_strdup(buf));
});
smartlist_sort_strings(entries);