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:
Michael Scott 2018-07-12 10:00:02 -07:00 committed by Jukka Rissanen
commit ce48f18d10

View file

@ -3124,7 +3124,8 @@ static int handle_request(struct coap_packet *request,
}
/* 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) {
/* '/' is used by bootstrap-delete only */