mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
sys/net/nanocoap: correctly initialize array
This commit is contained in:
parent
95da51bd7f
commit
8b06560c02
@ -784,7 +784,7 @@ static ssize_t _add_opt_pkt(coap_pkt_t *pkt, uint16_t optnum, const uint8_t *val
|
|||||||
assert(optnum >= lastonum);
|
assert(optnum >= lastonum);
|
||||||
|
|
||||||
/* calculate option length */
|
/* calculate option length */
|
||||||
uint8_t dummy[3];
|
uint8_t dummy[3] = { 0 };
|
||||||
size_t optlen = _put_delta_optlen(dummy, 1, 4, optnum - lastonum);
|
size_t optlen = _put_delta_optlen(dummy, 1, 4, optnum - lastonum);
|
||||||
optlen += _put_delta_optlen(dummy, 0, 0, val_len);
|
optlen += _put_delta_optlen(dummy, 0, 0, val_len);
|
||||||
optlen += val_len;
|
optlen += val_len;
|
||||||
|
Loading…
Reference in New Issue
Block a user