1
0
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:
Ken Bannister 2019-01-23 16:19:47 -05:00
parent e1bebed512
commit e35bcb6853

View File

@ -364,7 +364,7 @@ ssize_t coap_build_reply(coap_pkt_t *pkt, unsigned code,
unsigned tkl = coap_get_token_len(pkt);
unsigned len = sizeof(coap_hdr_t) + tkl;
if ((len + payload_len + 1) > rlen) {
if ((len + payload_len) > rlen) {
return -ENOSPC;
}