Skip to content

Commit 9fb70cb

Browse files
committed
Import latest fixes from upstream jsonlib (#132)
* Fix an off-by-one error that might affect us, etc.
1 parent b0e137f commit 9fb70cb

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
@@ -78,7 +78,7 @@ String jsonExtract(String json, String name){
7878
if(next == '\"'){
7979
//Serial.println(".. a string");
8080
start = start + 1;
81-
stop = json.indexOf('"', start + 1);
81+
stop = json.indexOf('"', start);
8282
}
8383
else if(next == '['){
8484
//Serial.println(".. a list");
@@ -111,7 +111,7 @@ String jsonExtract(String json, String name){
111111
else if(next == '.' || next == '-' || ('0' <= next && next <= '9')){
112112
//Serial.println(".. a number");
113113
int i = start;
114-
while((i++ < json.length() && json.charAt(i) == '.') || ('0' <= json.charAt(i) && json.charAt(i) <= '9')){
114+
while(i++ < json.length() && (json.charAt(i) == '.' || ('0' <= json.charAt(i) && json.charAt(i) <= '9'))){
115115
}
116116
stop = i;
117117
}

0 commit comments

Comments
 (0)