diff options
author | irungentoo_trip <irungentoo@gmail.com> | 2014-10-24 18:05:11 -0700 |
---|---|---|
committer | irungentoo_trip <irungentoo@gmail.com> | 2014-10-24 18:05:11 -0700 |
commit | c8812d4734bc92be34df076accb3a8e416a94d9d (patch) | |
tree | 6667d39cb2fcbd9c8e5174e3768ac185fb5c0a35 /toxcore/Messenger.c | |
parent | 9878b441b1d2b175b20d28cc41406280e3cada31 (diff) | |
parent | f73ad4ab05aaf35cd720dffbdc47c28d35d609e1 (diff) |
Merge branch 'big_endian_save'
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 4841cbd9..eaf87179 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -2648,10 +2648,9 @@ uint32_t messenger_size(const Messenger *m) | |||
2648 | 2648 | ||
2649 | static uint8_t *z_state_save_subheader(uint8_t *data, uint32_t len, uint16_t type) | 2649 | static uint8_t *z_state_save_subheader(uint8_t *data, uint32_t len, uint16_t type) |
2650 | { | 2650 | { |
2651 | memcpy(data, &len, sizeof(uint32_t)); | 2651 | host_to_lendian32(data, len); |
2652 | data += sizeof(uint32_t); | 2652 | data += sizeof(uint32_t); |
2653 | uint32_t temp = (MESSENGER_STATE_COOKIE_TYPE << 16) | type; | 2653 | host_to_lendian32(data, (host_tolendian16(MESSENGER_STATE_COOKIE_TYPE) << 16) | host_tolendian16(type)); |
2654 | memcpy(data, &temp, sizeof(uint32_t)); | ||
2655 | data += sizeof(uint32_t); | 2654 | data += sizeof(uint32_t); |
2656 | return data; | 2655 | return data; |
2657 | } | 2656 | } |