diff options
author | 2019-05-22 14:56:59 +0300 | |
---|---|---|
committer | 2019-05-22 14:56:59 +0300 | |
commit | 27992079c057ea068a355e01365800d77b7ace13 (patch) | |
tree | a78f18dd6e5faa298c26c93f490d02b51e4c7c39 /src/common | |
parent | 3fa7dd642af57b8b138e9a0d674c2d9960ebedf4 (diff) | |
download | usurpation-27992079c057ea068a355e01365800d77b7ace13.tar.gz usurpation-27992079c057ea068a355e01365800d77b7ace13.tar.bz2 usurpation-27992079c057ea068a355e01365800d77b7ace13.zip |
Protocol: attempted to fix stupids.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/protocol.c (renamed from src/common/protocol.cpp) | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/protocol.cpp b/src/common/protocol.c index 135be37..43ff6a5 100644 --- a/src/common/protocol.cpp +++ b/src/common/protocol.c @@ -83,8 +83,8 @@ static int push_timestamp(cd_t connection, const char *data) static int push_request(cd_t connection, const char *data) { - return push_tlv_header(connection, REQUEST, sizeof(msg_idx_t)) - | push_bytes(connection, data, sizeof(msg_idx_t)); + return push_tlv_header(connection, REQUEST, sizeof(msg_idx_t)) + | push_bytes(connection, data, sizeof(msg_idx_t)); } static int push_reply(cd_t connection, const char *data) @@ -120,7 +120,7 @@ size_t tlv_count(const struct packet_data * const packet) return ret; } -size_t get_tlvs( const struct packet_data * const data, +size_t get_tlvs( const struct packet_data * const data, struct tlv *buf, size_t buf_size) { @@ -147,7 +147,7 @@ size_t parse_tlv(const char *data, size_t cursor, struct tlv *t) cursor += sizeof(enum tlv_type); t->length += READ_AS(enum tlv_type ,data + cursor); data += sizeof(size_t); - t->data = (void*)data + cursor; + t->data = data + cursor; return data + cursor - begin + 1UL; } |