aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows/win_rand.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-14 13:00:55 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-14 13:00:55 -0800
commitf4ce5a285167e7656037096f77f04ab80a010453 (patch)
tree48a9746e154872e4a01c9dee465aed716af278be /src/platform/windows/win_rand.c
parentb639e4d3643b8245b77bc8707a3a864221fad195 (diff)
downloadnng-f4ce5a285167e7656037096f77f04ab80a010453.tar.gz
nng-f4ce5a285167e7656037096f77f04ab80a010453.tar.bz2
nng-f4ce5a285167e7656037096f77f04ab80a010453.zip
Windows TCP now working.
There are lots of changes here, mostly stuff we did in support of Windows TCP. However, there are some bugs that were fixed, and we added some new error codes, and generalized the handling of some failures during accept. Windows IPC (NamedPipes) is still missing.
Diffstat (limited to 'src/platform/windows/win_rand.c')
-rw-r--r--src/platform/windows/win_rand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/platform/windows/win_rand.c b/src/platform/windows/win_rand.c
index 1cabb6a0..8bca5927 100644
--- a/src/platform/windows/win_rand.c
+++ b/src/platform/windows/win_rand.c
@@ -17,13 +17,14 @@ void
nni_plat_seed_prng(void *buf, size_t bufsz)
{
unsigned val;
+
// The rand_s routine uses RtlGenRandom to get high quality
// pseudo random numbers (i.e. numbers that should be good enough
// for use with crypto keying.)
while (bufsz > sizeof (val)) {
rand_s(&val);
memcpy(buf, &val, sizeof (val));
- buf = (((char *)buf) + sizeof (val));
+ buf = (((char *) buf) + sizeof (val));
bufsz -= sizeof (val);
}
}