diff options
author | 2019-05-28 21:01:52 +0300 | |
---|---|---|
committer | 2019-05-28 21:01:52 +0300 | |
commit | 77c5d53360058b85ab1df84961b23f40a78fe3a8 (patch) | |
tree | 943746b6417bdddfe3c465e61ce52b8f211a934a /src | |
parent | 2b2eb7556424c2b85668f44c49602370bb6014ec (diff) | |
download | usurpation-77c5d53360058b85ab1df84961b23f40a78fe3a8.tar.gz usurpation-77c5d53360058b85ab1df84961b23f40a78fe3a8.tar.bz2 usurpation-77c5d53360058b85ab1df84961b23f40a78fe3a8.zip |
Protocol: fixed a stupid.
Had a local variable with the same name as argument.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/common/protocol.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/protocol.c b/src/common/protocol.c index 3f7bd24..ed636d2 100644 --- a/src/common/protocol.c +++ b/src/common/protocol.c @@ -103,24 +103,24 @@ static int push_tlv_header(struct tlv_packet *packet, enum tlv_type type, size_t int tlv_get(struct tlv_parser *parser, struct tlv *ret) { - int ret = 0; + int retval = 0; if (parser->offset + sizeof(ret->type) + sizeof(ret->length) >= parser->size) { - ret = E_TLV_OVERFLOW; + retval = E_TLV_OVERFLOW; } else if (parser -> offset == parser->size) { - ret = END_OF_PACKET; + retval = END_OF_PACKET; } else { ret->type = memcpy(&ret->type, parser->data + parser->offset, sizeof(ret->type)); parser->size += sizeof(ret->type); ret->length = memcpy(&ret->length, parser->data + parser->offset, sizeof(ret->length)); parser->offset += sizeof(ret->length); if (parser->offset + ret->length >= parser->size) { - ret = E_TLV_OVERFLOW; + retval = E_TLV_OVERFLOW; } else { memcpy(ret->data, parser->data, ret->length); } } - return ret; + return retval; } size_t tlv_data_size(struct tlv_parser *parser) |