Fix msg_opt_data

This commit is contained in:
Joseph C. Lehner 2016-02-13 23:54:51 +01:00
parent dc8851a553
commit 66d3a4431f

3
nmrp.c
View file

@ -218,6 +218,9 @@ static void *msg_opt_data(struct nmrp_msg *msg, int type, uint16_t *len)
while (remaining > 0) {
if (opt->type == type) {
if (opt->len == NMRP_OPT_LEN) {
return NULL;
}
*len = opt->len - NMRP_OPT_LEN;
return (char*)&opt->val;
}