mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
make os2Randomness() act the same as other platforms with SQLITE_TEST (all zeroed buffer) (CVS 5961)
FossilOrigin-Name: 5d189df39a3a5e99372826f87f9f20bbd92f1565
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user