diff options
Diffstat (limited to 'src/test2.c')
-rw-r--r-- | src/test2.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test2.c b/src/test2.c index 850e1e1a0..c75fa2eba 100644 --- a/src/test2.c +++ b/src/test2.c @@ -521,6 +521,14 @@ static int SQLITE_TCLAPI fake_big_file( return TCL_ERROR; } if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR; +#if defined(_WIN32) + if( n>2 ){ + Tcl_AppendResult(interp, "cannot create ", argv[1], + "MB file because Windows " + "does not support sparse files", (void*)0); + return TCL_ERROR; + } +#endif pVfs = sqlite3_vfs_find(0); nFile = (int)strlen(argv[2]); @@ -600,7 +608,7 @@ static int faultSimCallback(int x){ zInt[i] = (x%10) + '0'; } if( isNeg ) zInt[i--] = '-'; - memcpy(faultSimScript+faultSimScriptSize, zInt+i+1, sizeof(zInt)-i); + memcpy(faultSimScript+faultSimScriptSize, zInt+i+1, sizeof(zInt)-i-1); } rc = Tcl_Eval(faultSimInterp, faultSimScript); if( rc ){ |