Use snprintf() in place of sprintf() in a debugging function in the CLI.

FossilOrigin-Name: 5e5e4d2b4958c329578d1e5af4ed25c1b774f0ed2d15fa6747d7d7fbbba4fa46
This commit is contained in:
drh 2023-10-09 22:45:10 +00:00
parent 6c96bf2c3f
commit aaf1341dcd
3 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Avoid\scalling\ssqlite3_randomness\sand\staking\sthe\sPRNG\smutex\swhen\swriting\sa\sjournal\sheader\sin\s"journal_mode=memory"\smode.
D 2023-10-09T17:54:34.805
C Use\ssnprintf()\sin\splace\sof\ssprintf()\sin\sa\sdebugging\sfunction\sin\sthe\sCLI.
D 2023-10-09T22:45:10.768
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -715,7 +715,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c 0c3046b88901336709cd09f474303a16fc54bce13a2befcab66d0fa6b44ca869
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 7f9155185be78902818b21c2cd3e33f01b4306279a15d6719eb1bbb9779034aa
F src/shell.c.in b34146fe139a7d0f5f49de5059e7bbe6892f9d5dce952c6f9f7a602e5df86466
F src/shell.c.in 6d26db96a7d53e7b499c8ae2f794dfc020a96e64d5757aebd0e4cf743b6de031
F src/sqlite.h.in 4f39f61c35348f0c56dd2c7a2294d1f0564389a0086dab80ce0960bfd772dc1b
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 2f30b2671f4c03cd27a43f039e11251391066c97d11385f5f963bb40b03038ac
@ -2128,8 +2128,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 1f1a358af77f4386f98010eeae8487e6d39548a6dfe58c2664552490e7661122
R cb97a01edd9563d34e6c8de016f82192
U dan
Z 70f60047d69ba97a07899a1fb54836c4
P c84e4483cb44f827416d8caafa22f076b2f31b2024fe8c5b5bcb0c9955149d11
R 3906d2c8d8a5a36ffb2dadbfe6d4a26b
U drh
Z 827ed6f013493fe3f4e23b8be3f541d3
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
c84e4483cb44f827416d8caafa22f076b2f31b2024fe8c5b5bcb0c9955149d11
5e5e4d2b4958c329578d1e5af4ed25c1b774f0ed2d15fa6747d7d7fbbba4fa46

View File

@ -1228,7 +1228,7 @@ static void shellDtostr(
char z[400];
if( n<1 ) n = 1;
if( n>350 ) n = 350;
sprintf(z, "%#+.*e", n, r);
snprintf(z, sizeof(z)-1, "%#+.*e", n, r);
sqlite3_result_text(pCtx, z, -1, SQLITE_TRANSIENT);
}