summaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2010-09-20 18:40:32 -0400
committerRoger Dingledine <arma@torproject.org>2010-09-20 18:40:32 -0400
commit47b23bd03e005c7a86ddd1dbcba619c1840a3232 (patch)
treea01b52445785e4df256241c3de76c496fe4481c1 /src/or/connection_or.c
parentff5ffd17760379612b1204fa4de9ab1e6980aac9 (diff)
downloadtor-47b23bd03e005c7a86ddd1dbcba619c1840a3232.tar.gz
tor-47b23bd03e005c7a86ddd1dbcba619c1840a3232.zip
A start at a patch for bug 1943 (alignment issues)
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 58e8ec7e7e..6b648b124d 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -147,7 +147,7 @@ void
cell_pack(packed_cell_t *dst, const cell_t *src)
{
char *dest = dst->body;
- *(uint16_t*)dest = htons(src->circ_id);
+ set_uint16(dest, htons(src->circ_id));
*(uint8_t*)(dest+2) = src->command;
memcpy(dest+3, src->payload, CELL_PAYLOAD_SIZE);
}
@@ -158,7 +158,7 @@ cell_pack(packed_cell_t *dst, const cell_t *src)
static void
cell_unpack(cell_t *dest, const char *src)
{
- dest->circ_id = ntohs(*(uint16_t*)(src));
+ dest->circ_id = ntohs(get_uint16(src));
dest->command = *(uint8_t*)(src+2);
memcpy(dest->payload, src+3, CELL_PAYLOAD_SIZE);
}