summaryrefslogtreecommitdiff
path: root/src/test3.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2012-09-20 18:34:42 -0400
committerHans-Christoph Steiner <hans@eds.org>2012-09-20 18:34:42 -0400
commit734b4f890763e4efafe865ba476c43cc8d1a2214 (patch)
treed561d2fad0788619f4b8e230073f6af1d416934e /src/test3.c
parent396b08286e7bb56e0e6440aaf1345c18e72ee22e (diff)
parent487e15dc239ccdb3344d1c99ce120e872bab4a74 (diff)
Merge tag 'upstream/2.0.6'
Upstream version 2.0.6
Diffstat (limited to 'src/test3.c')
-rw-r--r--src/test3.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/test3.c b/src/test3.c
index 4eabdcc..e460c42 100644
--- a/src/test3.c
+++ b/src/test3.c
@@ -66,6 +66,8 @@ static int btree_open(
Btree *pBt;
int rc, nCache;
char zBuf[100];
+ int n;
+ char *zFilename;
if( argc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" FILENAME NCACHE FLAGS\"", 0);
@@ -78,8 +80,14 @@ static int btree_open(
sDb.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
sqlite3_mutex_enter(sDb.mutex);
}
- rc = sqlite3BtreeOpen(sDb.pVfs, argv[1], &sDb, &pBt, 0,
+ n = (int)strlen(argv[1]);
+ zFilename = sqlite3_malloc( n+2 );
+ if( zFilename==0 ) return TCL_ERROR;
+ memcpy(zFilename, argv[1], n+1);
+ zFilename[n+1] = 0;
+ rc = sqlite3BtreeOpen(sDb.pVfs, zFilename, &sDb, &pBt, 0,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB);
+ sqlite3_free(zFilename);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
@@ -457,7 +465,7 @@ static int btree_varint_test(
if( Tcl_GetInt(interp, argv[4], (int*)&incr) ) return TCL_ERROR;
in = start;
in *= mult;
- for(i=0; i<count; i++){
+ for(i=0; i<(int)count; i++){
char zErr[200];
n1 = putVarint(zBuf, in);
if( n1>9 || n1<1 ){