diff options
author | drh <> | 2023-12-18 13:51:54 +0000 |
---|---|---|
committer | drh <> | 2023-12-18 13:51:54 +0000 |
commit | 52a4691fff3333dc8b97253064b20c07e044d58c (patch) | |
tree | 8006652ff1b34f4cefeb72c42089d4eadfd01d81 /ext/misc/randomjson.c | |
parent | 2ae95649de300b2c6f7d501b246b740f4dd4dee1 (diff) | |
download | sqlite-52a4691fff3333dc8b97253064b20c07e044d58c.tar.gz sqlite-52a4691fff3333dc8b97253064b20c07e044d58c.zip |
Bug fix in the randomjson.c extension.
FossilOrigin-Name: 1f3a33df530dbe330ea8b14a69369b807b413b25a167d1a3938f8f0faf97cc91
Diffstat (limited to 'ext/misc/randomjson.c')
-rw-r--r-- | ext/misc/randomjson.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/misc/randomjson.c b/ext/misc/randomjson.c index d64eb6932..20ee12b9f 100644 --- a/ext/misc/randomjson.c +++ b/ext/misc/randomjson.c @@ -138,11 +138,7 @@ static void jsonExpand( char zBuf[200]; j = 0; - if( zSrc==0 ){ - k = prngInt(p)%(count(azJsonTemplate)/2); - k = k*2 + eType; - zSrc = azJsonTemplate[k]; - } + if( zSrc==0 ) zSrc = "%"; if( strlen(zSrc)>=STRSZ/10 ) r = 0; for(i=0; zSrc[i]; i++){ if( zSrc[i]!='%' ){ @@ -182,6 +178,8 @@ static void jsonExpand( zX = strstr(zX, "DD"); } } + assert( strstr(z, "XX")==0 ); + assert( strstr(z, "DD")==0 ); if( j+n<STRSZ ){ memcpy(&zDest[j], z, n); j += (int)n; |