Skip to content

Commit 56c5267

Browse files
authored
Import latest fixes from upstream jsonlib (#132)
* Fix an off-by-one error that might affect us, etc.
1 parent 5fef3bd commit 56c5267

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jsonlib/jsonlib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ String jsonExtract(String json, String name){
7979
if(next == '\"'){
8080
//Serial.println(".. a string");
8181
start = start + 1;
82-
stop = json.indexOf('"', start + 1);
82+
stop = json.indexOf('"', start);
8383
}
8484
else if(next == '['){
8585
//Serial.println(".. a list");
@@ -112,7 +112,7 @@ String jsonExtract(String json, String name){
112112
else if(next == '.' || next == '-' || ('0' <= next && next <= '9')){
113113
//Serial.println(".. a number");
114114
int i = start;
115-
while((i++ < json.length() && json.charAt(i) == '.') || ('0' <= json.charAt(i) && json.charAt(i) <= '9')){
115+
while(i++ < json.length() && (json.charAt(i) == '.' || ('0' <= json.charAt(i) && json.charAt(i) <= '9'))){
116116
}
117117
stop = i;
118118
}

0 commit comments

Comments
 (0)