mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Eliminate all uses of sprintf() and strcpy(). These were not being
misused. But getting rid of them removes a library dependency. And it avoids warnings from the OpenBSD compiler. Ticket #2336. (CVS 3916) FossilOrigin-Name: ba4845b32bdf38e623c4f7246e6e327715bbba4b
This commit is contained in:
10
src/pager.c
10
src/pager.c
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.334 2007/05/04 12:01:03 drh Exp $
|
||||
** @(#) $Id: pager.c,v 1.335 2007/05/04 13:15:56 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -1736,14 +1736,14 @@ int sqlite3PagerOpen(
|
||||
pPager->zFilename = (char*)&pPager[1];
|
||||
pPager->zDirectory = &pPager->zFilename[nameLen+1];
|
||||
pPager->zJournal = &pPager->zDirectory[nameLen+1];
|
||||
strcpy(pPager->zFilename, zFullPathname);
|
||||
strcpy(pPager->zDirectory, zFullPathname);
|
||||
memcpy(pPager->zFilename, zFullPathname, nameLen+1);
|
||||
memcpy(pPager->zDirectory, zFullPathname, nameLen+1);
|
||||
|
||||
for(i=nameLen; i>0 && pPager->zDirectory[i-1]!='/'; i--){}
|
||||
if( i>0 ) pPager->zDirectory[i-1] = 0;
|
||||
strcpy(pPager->zJournal, zFullPathname);
|
||||
memcpy(pPager->zJournal, zFullPathname,nameLen);
|
||||
sqliteFree(zFullPathname);
|
||||
strcpy(&pPager->zJournal[nameLen], "-journal");
|
||||
memcpy(&pPager->zJournal[nameLen], "-journal",sizeof("-journal"));
|
||||
pPager->fd = fd;
|
||||
/* pPager->journalOpen = 0; */
|
||||
pPager->useJournal = useJournal && !memDb;
|
||||
|
Reference in New Issue
Block a user