aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-09-11 13:20:15 -0400
committerNick Mathewson <nickm@torproject.org>2012-09-11 13:20:15 -0400
commit5833861f62d2667eeda1ed0f6595763aa00250b0 (patch)
tree654dcbc4cd6faf1a30d9e0ce5fbc9025d89e8f8c /src/or/dirvote.c
parent8731a4e148e23d8edbb7f32bdfeee30c326f33cc (diff)
parent84f47ffc462dface8db1def322414daa43400d1c (diff)
downloadtor-5833861f62d2667eeda1ed0f6595763aa00250b0.tar
tor-5833861f62d2667eeda1ed0f6595763aa00250b0.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3
Conflicts: src/test/test_util.c
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index b3de90b5c..144859ae0 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -2515,7 +2515,7 @@ time_t
dirvote_get_start_of_next_interval(time_t now, int interval)
{
struct tm tm;
- time_t midnight_today;
+ time_t midnight_today=0;
time_t midnight_tomorrow;
time_t next;
@@ -2524,7 +2524,9 @@ dirvote_get_start_of_next_interval(time_t now, int interval)
tm.tm_min = 0;
tm.tm_sec = 0;
- midnight_today = tor_timegm(&tm);
+ if (tor_timegm(&tm, &midnight_today) < 0) {
+ log_warn(LD_BUG, "Ran into an invalid time when trying to find midnight.");
+ }
midnight_tomorrow = midnight_today + (24*60*60);
next = midnight_today + ((now-midnight_today)/interval + 1)*interval;