mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Eliminate all use of sprintf(), strcpy() and strcat() from test logic because
OpenBSD hates those functions. FossilOrigin-Name: 10321910990195878c0af1e94b34ae0cdc0cb31b
This commit is contained in:
@@ -823,11 +823,12 @@ static int tvfsShmOpen(sqlite3_file *pFile){
|
||||
if( 0==strcmp(pFd->zFilename, pBuffer->zFile) ) break;
|
||||
}
|
||||
if( !pBuffer ){
|
||||
int nByte = sizeof(TestvfsBuffer) + (int)strlen(pFd->zFilename) + 1;
|
||||
int szName = (int)strlen(pFd->zFilename);
|
||||
int nByte = sizeof(TestvfsBuffer) + szName + 1;
|
||||
pBuffer = (TestvfsBuffer *)ckalloc(nByte);
|
||||
memset(pBuffer, 0, nByte);
|
||||
pBuffer->zFile = (char *)&pBuffer[1];
|
||||
strcpy(pBuffer->zFile, pFd->zFilename);
|
||||
memcpy(pBuffer->zFile, pFd->zFilename, szName+1);
|
||||
pBuffer->pNext = p->pBuffer;
|
||||
p->pBuffer = pBuffer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user