1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Do not use memcpy() of zero bytes when initializing a pager. This avoids

a warning.

FossilOrigin-Name: cca437788e092b21ed1784dd94d4b1c7204ff1717538d276a10880d1345904bd
This commit is contained in:
drh
2020-01-18 19:46:42 +00:00
parent a01fda7113
commit f71eb2091f
3 changed files with 13 additions and 11 deletions

View File

@@ -4911,11 +4911,13 @@ int sqlite3PagerOpen(
/* Fill in the Pager.zFilename and pPager.zQueryParam fields */
pPtr[0] = '\003'; pPtr[1] = 0; pPtr += 2;
pPager->zFilename = (char*)pPtr;
memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1;
if( zUri ){
memcpy(pPtr, zUri, nUriByte); /* pPtr += nUriByte; // not needed */
if( nPathname>0 ){
memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1;
if( zUri ){
memcpy(pPtr, zUri, nUriByte); /* pPtr += nUriByte; // not needed */
}
/* Double-zero terminator implied by the sqlite3MallocZero */
}
/* Double-zero terminator implied by the sqlite3MallocZero */
if( nPathname ) sqlite3DbFree(0, zPathname);
pPager->pVfs = pVfs;