From a1e5f53ddd775d041f0017cec6824adddfc43009 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Wed, 31 Aug 2022 19:21:00 +0200 Subject: [PATCH] Berry fix json crash --- lib/libesp32/berry/src/be_strlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libesp32/berry/src/be_strlib.c b/lib/libesp32/berry/src/be_strlib.c index 23fdf978f..2c5424634 100644 --- a/lib/libesp32/berry/src/be_strlib.c +++ b/lib/libesp32/berry/src/be_strlib.c @@ -263,6 +263,9 @@ BERRY_API bint be_str2int(const char *str, const char **endstr) while ((c = be_char2hex(*str++)) >= 0) { sum = sum * 16 + c; } + if (endstr) { + *endstr = str - 1; + } return sum; } else { /* decimal literal */