summaryrefslogtreecommitdiff
path: root/src/c/urweb.c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2015-01-22 09:46:20 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2015-01-22 09:46:20 -0500
commit2207f580efc424d40c81d4dd98fb414e29eaa7f9 (patch)
tree1c47d0195ff76fe9a111e155c6ff78e3fe84cd00 /src/c/urweb.c
parent9b8fc824ae3fe7176abf67fecb811dd5bdb89cda (diff)
Fix silly mistake from last commit; also switch away from rand() in openssl.c
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r--src/c/urweb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 4a00755b..7ad58e1d 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -171,11 +171,11 @@ static pthread_mutex_t rand_mutex = PTHREAD_MUTEX_INITIALIZER;
static uw_Basis_int my_rand() {
pthread_mutex_lock(&rand_mutex);
- int r = RAND_bytes((unsigned char *)&ret, sizeof ret);
+ int ret, r = RAND_bytes((unsigned char *)&ret, sizeof ret);
pthread_mutex_unlock(&rand_mutex);
if (r)
- return abs(r);
+ return abs(ret);
else
return -1;
}
@@ -362,8 +362,6 @@ extern void uw_global_custom();
extern void uw_init_crypto();
void uw_global_init() {
- srand(time(NULL) ^ getpid());
-
clients = malloc(0);
uw_global_custom();