From 3aa44159c53af1d6459a85dc1841c7c494d52464 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 9 Apr 2012 11:30:46 -0400 Subject: Tweak the new evutil_weakrand_() code Make its state actually get seeded. Document it more thoroughly. Turn its state into a structure. Fix a bug in evutil_weakrand_range_() where it could return the top of the range. Change its return type to ev_int32_t. Add a quick unit test to make sure that the value of evutil_weakrand_range_() is in range. --- win32select.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'win32select.c') diff --git a/win32select.c b/win32select.c index ce2d525f..7be2389f 100644 --- a/win32select.c +++ b/win32select.c @@ -202,6 +202,8 @@ win32_init(struct event_base *base) if (evsig_init_(base) < 0) winop->signals_are_broken = 1; + evutil_weakrand_seed_(&base->weakrand_seed, 0); + return (winop); err: XFREE(winop->readset_in); -- cgit v1.2.1