mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
net/nanocoap: fix remaining space calculation
The space calculation must use the same length as the eventual return value.
This commit is contained in:
parent
e1bebed512
commit
e35bcb6853
@ -364,7 +364,7 @@ ssize_t coap_build_reply(coap_pkt_t *pkt, unsigned code,
|
|||||||
unsigned tkl = coap_get_token_len(pkt);
|
unsigned tkl = coap_get_token_len(pkt);
|
||||||
unsigned len = sizeof(coap_hdr_t) + tkl;
|
unsigned len = sizeof(coap_hdr_t) + tkl;
|
||||||
|
|
||||||
if ((len + payload_len + 1) > rlen) {
|
if ((len + payload_len) > rlen) {
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user