diff options
author | pweilbacher <pweilbacher@noemail.net> | 2008-11-26 19:56:48 +0000 |
---|---|---|
committer | pweilbacher <pweilbacher@noemail.net> | 2008-11-26 19:56:48 +0000 |
commit | efdabe9e64e7526ca08540ed88a7aff81ec4eefb (patch) | |
tree | eeb099a5b3bb3c5667835645ea55e3963e077171 /src | |
parent | a9bce108bedef7d168dee75c860ad12b4d07274f (diff) | |
download | sqlite-efdabe9e64e7526ca08540ed88a7aff81ec4eefb.tar.gz sqlite-efdabe9e64e7526ca08540ed88a7aff81ec4eefb.zip |
make os2Randomness() act the same as other platforms with SQLITE_TEST (all zeroed buffer) (CVS 5961)
FossilOrigin-Name: 5d189df39a3a5e99372826f87f9f20bbd92f1565
Diffstat (limited to 'src')
-rw-r--r-- | src/os_os2.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/os_os2.c b/src/os_os2.c index 058a80130..fb175e8c9 100644 --- a/src/os_os2.c +++ b/src/os_os2.c @@ -12,7 +12,7 @@ ** ** This file contains code that is specific to OS/2. ** -** $Id: os_os2.c,v 1.60 2008/11/22 19:50:54 pweilbacher Exp $ +** $Id: os_os2.c,v 1.61 2008/11/26 19:56:48 pweilbacher Exp $ */ #include "sqliteInt.h" @@ -966,8 +966,12 @@ static void os2DlClose(sqlite3_vfs *pVfs, void *pHandle){ ** Write up to nBuf bytes of randomness into zBuf. */ static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){ - int sizeofULong = sizeof(ULONG); int n = 0; +#if defined(SQLITE_TEST) + n = nBuf; + memset(zBuf, 0, nBuf); +#else + int sizeofULong = sizeof(ULONG); if( (int)sizeof(DATETIME) <= nBuf - n ){ DATETIME x; DosGetDateTime(&x); @@ -1015,6 +1019,7 @@ static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){ n += sizeofULong; } } +#endif return n; } |