diff options
author | Neel Chauhan <neel@neelc.org> | 2017-07-31 19:30:30 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-03 08:56:35 -0400 |
commit | 5ee6ca8da22ad8da94c829e6c02c05920742c364 (patch) | |
tree | 4e69b0cc5f825f316aa05b290d2340c94e46c3ea /src/or/connection_or.c | |
parent | 02fcb29d11abe9556ab4d118f2f89e557d1751dd (diff) | |
download | tor-5ee6ca8da22ad8da94c829e6c02c05920742c364.tar.gz tor-5ee6ca8da22ad8da94c829e6c02c05920742c364.zip |
Switch to offsetof()
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 051bf9a176..7c929e5272 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -472,7 +472,7 @@ var_cell_pack_header(const var_cell_t *cell, char *hdr_out, int wide_circ_ids) var_cell_t * var_cell_new(uint16_t payload_len) { - size_t size = STRUCT_OFFSET(var_cell_t, payload) + payload_len; + size_t size = offsetof(var_cell_t, payload) + payload_len; var_cell_t *cell = tor_malloc_zero(size); cell->payload_len = payload_len; cell->command = 0; @@ -491,7 +491,7 @@ var_cell_copy(const var_cell_t *src) size_t size = 0; if (src != NULL) { - size = STRUCT_OFFSET(var_cell_t, payload) + src->payload_len; + size = offsetof(var_cell_t, payload) + src->payload_len; copy = tor_malloc_zero(size); copy->payload_len = src->payload_len; copy->command = src->command; |