1
0
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:
drh
2015-01-19 00:35:53 +00:00
parent 047d4538e3
commit 65545b5993
12 changed files with 84 additions and 59 deletions

View File

@@ -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;
}