From: drh <> Date: Fri, 28 Apr 2023 23:19:11 +0000 (+0000) Subject: Bug fix in the offset computation for json_error(). X-Git-Tag: version-3.42.0~73^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e2de57963198789e6df238962351fa4b840851e;p=thirdparty%2Fsqlite.git Bug fix in the offset computation for json_error(). FossilOrigin-Name: 8f7ab5d9210490eb451534df246b82081a5aa252a1bd662659df3da429290837 --- diff --git a/manifest b/manifest index c10ebff82d..0d0cafc8eb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\sthe\saccuracy\sof\sjson_error().\s\sAdd\sthe\sextension\sSQL\nfunctions\srandom_json(SEED)\sand\srandom_json5(SEED). -D 2023-04-28T17:38:35.385 +C Bug\sfix\sin\sthe\soffset\scomputation\sfor\sjson_error(). +D 2023-04-28T23:19:11.271 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -594,7 +594,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51 F src/hwtime.h b638809e083b601b618df877b2e89cb87c2a47a01f4def10be4c4ebb54664ac7 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c a8de1db43335fc4946370a7a7e47d89975ad678ddb15078a150e993ba2fb37d4 -F src/json.c 03eba427c0e8700db2895b785642f4dba8440020658d8eef97ec4fadf3836cdf +F src/json.c cc36f7df741f617624abc73adba6ffea1f3358196e1b78b43124265e941d332a F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c be5af440f3192c58681b5d43167dbca3ccbfce394d89faa22378a14264781136 F src/main.c 09bc5191f75dc48fc4dfddda143cb864c0c3dbc3297eb9a9c8e01fea58ff847d @@ -2067,8 +2067,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 901ad995d5a722ca2672516205ff488e9acd703a828ca5fc43f11fca5f2af120 -R c710d125f016d21291562e41606e0d2f +P 8d09dc1c45a8026b94f70273d064e47939f30cadedc17548b5a26ba054a8d3a7 +R 85ded77d7e850b8c4e5d880f9f34a021 U drh -Z 98bfef108d9db21095967c25b17439f3 +Z 6b839a1d682f3ab7c8bf4f474d197593 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2d0bc4ddaf..7bde04d486 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8d09dc1c45a8026b94f70273d064e47939f30cadedc17548b5a26ba054a8d3a7 \ No newline at end of file +8f7ab5d9210490eb451534df246b82081a5aa252a1bd662659df3da429290837 \ No newline at end of file diff --git a/src/json.c b/src/json.c index f76d7dc5a7..83b02bf5a4 100644 --- a/src/json.c +++ b/src/json.c @@ -2606,11 +2606,11 @@ static void jsonErrorFunc( if( p==0 || p->oom || p->nErr==0 ){ sqlite3_result_int(ctx, 0); }else{ - int n = 0; + int n = 1; int i; const char *z = p->zJson; for(i=0; iiErr && z[i]; i++){ - if( (z[i]&0xc0)!=80 ) n++; + if( (z[i]&0xc0)!=0x80 ) n++; } sqlite3_result_int(ctx, n); jsonParseFree(p);