diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-09-11 13:20:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-09-11 13:20:15 -0400 |
commit | 5833861f62d2667eeda1ed0f6595763aa00250b0 (patch) | |
tree | 654dcbc4cd6faf1a30d9e0ce5fbc9025d89e8f8c /src/or/dirvote.c | |
parent | 8731a4e148e23d8edbb7f32bdfeee30c326f33cc (diff) | |
parent | 84f47ffc462dface8db1def322414daa43400d1c (diff) | |
download | tor-5833861f62d2667eeda1ed0f6595763aa00250b0.tar.gz tor-5833861f62d2667eeda1ed0f6595763aa00250b0.zip |
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index b3de90b5c0..144859ae04 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; |