mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
net/nanocoap: use coap_data_ptr instead of hdr.data
This commit is contained in:
parent
2ddd8ce1a9
commit
18ae8ef90d
@ -62,7 +62,7 @@ int coap_parse(coap_pkt_t *pkt, uint8_t *buf, size_t len)
|
||||
coap_hdr_t *hdr = (coap_hdr_t *)buf;
|
||||
pkt->hdr = hdr;
|
||||
|
||||
uint8_t *pkt_pos = hdr->data;
|
||||
uint8_t *pkt_pos = coap_hdr_data_ptr(hdr);
|
||||
uint8_t *pkt_end = buf + len;
|
||||
|
||||
pkt->payload = NULL;
|
||||
@ -402,7 +402,7 @@ ssize_t coap_build_hdr(coap_hdr_t *hdr, unsigned type, uint8_t *token, size_t to
|
||||
hdr->id = htons(id);
|
||||
|
||||
if (token_len) {
|
||||
memcpy(hdr->data, token, token_len);
|
||||
memcpy(coap_hdr_data_ptr(hdr), token, token_len);
|
||||
}
|
||||
|
||||
return sizeof(coap_hdr_t) + token_len;
|
||||
|
Loading…
Reference in New Issue
Block a user