diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-05-15 11:43:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-15 11:43:18 -0400 |
commit | a6514b8a20b7a6fafb72bafad1e9c98a8e35cdee (patch) | |
tree | 3d1b7c42a98cbb965dabf0edcbe5c5b6e2b66385 /src/or/hibernate.c | |
parent | 5207e41ffeb99089adbb56376c0759b97a556801 (diff) | |
download | tor-a6514b8a20b7a6fafb72bafad1e9c98a8e35cdee.tar.gz tor-a6514b8a20b7a6fafb72bafad1e9c98a8e35cdee.zip |
Fix a logic error in hibernate.c
Closes bug 22245; bugfix on 0.0.9rc1, when bandwidth accounting was
first introduced.
Found by Andrey Karpov and reported at https://www.viva64.com/en/b/0507/
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r-- | src/or/hibernate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c index a412571331..e5ed3d4119 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -290,7 +290,7 @@ edge_of_accounting_period_containing(time_t now, int get_end) case UNIT_MONTH: { /* If this is before the Nth, we want the Nth of last month. */ if (tm.tm_mday < cfg_start_day || - (tm.tm_mday < cfg_start_day && before)) { + (tm.tm_mday == cfg_start_day && before)) { --tm.tm_mon; } /* Otherwise, the month is correct. */ |