summaryrefslogtreecommitdiff
path: root/src/or/hs_common.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-08-04 22:02:28 +0300
committerNick Mathewson <nickm@torproject.org>2017-08-08 20:29:34 -0400
commitc62da5cf95de0958d28d2dfd8cdc66cf11498ebe (patch)
tree22ee0284768e83db9055da7f38f7be7eb1877dec /src/or/hs_common.c
parent4ad4467fa13a0e6333fa0016a63060d5b9dd9715 (diff)
downloadtor-c62da5cf95de0958d28d2dfd8cdc66cf11498ebe.tar.gz
tor-c62da5cf95de0958d28d2dfd8cdc66cf11498ebe.zip
Improve code based on Nick review:
- Fix some more crazy ternary ops. - Fix the order of disaster SRV computation. - Whitespace fixes. - Remove a redundant warn. - Better docs.
Diffstat (limited to 'src/or/hs_common.c')
-rw-r--r--src/or/hs_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/hs_common.c b/src/or/hs_common.c
index a29b377494..f5c63cb6a0 100644
--- a/src/or/hs_common.c
+++ b/src/or/hs_common.c
@@ -521,9 +521,9 @@ get_disaster_srv(uint64_t time_period_num, uint8_t *srv_out)
uint64_t time_period_length = get_time_period_length();
char period_stuff[sizeof(uint64_t)*2];
size_t offset = 0;
- set_uint64(period_stuff, tor_htonll(time_period_num));
+ set_uint64(period_stuff, tor_htonll(time_period_length));
offset += sizeof(uint64_t);
- set_uint64(period_stuff+offset, tor_htonll(time_period_length));
+ set_uint64(period_stuff+offset, tor_htonll(time_period_num));
offset += sizeof(uint64_t);
tor_assert(offset == sizeof(period_stuff));