net: lwm2m: correct return value in tlv put
The function calculates the number of octets put, but does not return it. Call sites check for non-zero values suggesting this is a bug. See https://habr.com/en/company/pvs-studio/blog/495284/ fragment 12. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
4fb4d280d3
commit
abbd53ce1f
1 changed files with 1 additions and 1 deletions
|
@ -337,7 +337,7 @@ static size_t put_end_tlv(struct lwm2m_output_context *out, u16_t mark_pos,
|
|||
tlv_setup(&tlv, tlv_type, tlv_id, len);
|
||||
len = oma_tlv_put(&tlv, out, NULL, true) - tlv.length;
|
||||
|
||||
return 0;
|
||||
return len;
|
||||
}
|
||||
|
||||
static size_t put_begin_oi(struct lwm2m_output_context *out,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue