net: lwm2m: use isdigit in JSON formatter

Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
Michael Scott 2017-10-11 13:37:02 -07:00 committed by Jukka Rissanen
parent 078288b2be
commit fcd37eb79d

View file

@ -64,6 +64,7 @@
#include <stddef.h>
#include <stdint.h>
#include <inttypes.h>
#include <ctype.h>
#include "lwm2m_object.h"
#include "lwm2m_rw_json.h"
@ -527,7 +528,7 @@ static int parse_path(const u8_t *buf, u16_t buflen,
val = 0;
c = buf[pos];
/* we should get a value first - consume all numbers */
while (pos < buflen && c >= '0' && c <= '9') {
while (pos < buflen && isdigit(c)) {
val = val * 10 + (c - '0');
c = buf[++pos];
}