net: lwm2m: use ARRAY_SIZE to calculate # of options
Don't use hard-coded value of 4 for passing the # of options to coap_find_options() in handle_request(). This can easily get out of sync. Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
parent
538d3418fd
commit
ce48f18d10
1 changed files with 2 additions and 1 deletions
|
@ -3124,7 +3124,8 @@ static int handle_request(struct coap_packet *request,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parse the URL path into components */
|
/* parse the URL path into components */
|
||||||
r = coap_find_options(in.in_cpkt, COAP_OPTION_URI_PATH, options, 4);
|
r = coap_find_options(in.in_cpkt, COAP_OPTION_URI_PATH, options,
|
||||||
|
ARRAY_SIZE(options));
|
||||||
if (r <= 0) {
|
if (r <= 0) {
|
||||||
/* '/' is used by bootstrap-delete only */
|
/* '/' is used by bootstrap-delete only */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue