summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/md/os2/os2rng.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsprpub/pr/src/md/os2/os2rng.c')
-rw-r--r--nsprpub/pr/src/md/os2/os2rng.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/nsprpub/pr/src/md/os2/os2rng.c b/nsprpub/pr/src/md/os2/os2rng.c
index 72f7357fa..aaa969381 100644
--- a/nsprpub/pr/src/md/os2/os2rng.c
+++ b/nsprpub/pr/src/md/os2/os2rng.c
@@ -17,8 +17,9 @@ static BOOL clockTickTime(unsigned long *phigh, unsigned long *plow)
QWORD qword = {0,0};
rc = DosTmrQueryTime(&qword);
- if (rc != NO_ERROR)
- return FALSE;
+ if (rc != NO_ERROR) {
+ return FALSE;
+ }
*phigh = qword.ulHi;
*plow = qword.ulLo;
@@ -35,8 +36,9 @@ extern PRSize _PR_MD_GetRandomNoise(void *buf, PRSize size )
int nBytes = 0;
time_t sTime;
- if (size <= 0)
- return 0;
+ if (size <= 0) {
+ return 0;
+ }
clockTickTime(&high, &low);
@@ -46,16 +48,18 @@ extern PRSize _PR_MD_GetRandomNoise(void *buf, PRSize size )
n += nBytes;
size -= nBytes;
- if (size <= 0)
- return n;
+ if (size <= 0) {
+ return n;
+ }
nBytes = sizeof(high) > size ? size : sizeof(high);
memcpy(((char *)buf) + n, &high, nBytes);
n += nBytes;
size -= nBytes;
- if (size <= 0)
- return n;
+ if (size <= 0) {
+ return n;
+ }
/* get the number of milliseconds that have elapsed since application started */
val = clock();
@@ -65,8 +69,9 @@ extern PRSize _PR_MD_GetRandomNoise(void *buf, PRSize size )
n += nBytes;
size -= nBytes;
- if (size <= 0)
- return n;
+ if (size <= 0) {
+ return n;
+ }
/* get the time in seconds since midnight Jan 1, 1970 */
time(&sTime);