aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2023-04-28 17:38:35 +0000
committerdrh <>2023-04-28 17:38:35 +0000
commit8e7efe37645453fac5ca98f8a9837f34d14f75b6 (patch)
tree7f22fbdf69f6dcf485b46bdf5062f0d53a938b68 /src/json.c
parent272ae627c535b1ee11b82ba045c641945e34bdc5 (diff)
downloadsqlite-8e7efe37645453fac5ca98f8a9837f34d14f75b6.tar.gz
sqlite-8e7efe37645453fac5ca98f8a9837f34d14f75b6.zip
Improvements to the accuracy of json_error(). Add the extension SQL
functions random_json(SEED) and random_json5(SEED). FossilOrigin-Name: 8d09dc1c45a8026b94f70273d064e47939f30cadedc17548b5a26ba054a8d3a7
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/json.c b/src/json.c
index d1a057b48..f76d7dc5a 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1093,7 +1093,7 @@ json_parse_restart:
pParse->has5 = 1;
x = k;
}else{
- pParse->iErr = j;
+ if( x!=-1 ) pParse->iErr = j;
return -1;
}
}
@@ -1114,7 +1114,7 @@ json_parse_restart:
}
x = jsonParseValue(pParse, j);
if( x!=(-5) ){
- pParse->iErr = j;
+ if( x!=(-1) ) pParse->iErr = j;
return -1;
}
j = pParse->iErr+1;
@@ -1123,7 +1123,7 @@ json_parse_restart:
x = jsonParseValue(pParse, j);
pParse->iDepth--;
if( x<=0 ){
- pParse->iErr = j;
+ if( x!=(-1) ) pParse->iErr = j;
return -1;
}
j = x;
@@ -1174,7 +1174,7 @@ json_parse_restart:
if( pParse->nNode!=(u32)iThis+1 ) pParse->has5 = 1;
break;
}
- pParse->iErr = j;
+ if( x!=(-1) ) pParse->iErr = j;
return -1;
}
j = x;