Fix a compiler warning when checking for arc4random_buf linker breakage.

Patch by Ralph Castain.
This commit is contained in:
Nick Mathewson 2013-09-19 10:43:54 -04:00
parent 5eb178855a
commit 5cb3865a40

View File

@ -76,8 +76,11 @@ ev_arc4random_buf(void *buf, size_t n)
* and fall back otherwise. (OSX does this using some linker
* trickery.)
*/
if (arc4random_buf != NULL) {
return arc4random_buf(buf, n);
{
void (*tptr)() = (void*)arc4random_buf;
if (tptr != NULL) {
return arc4random_buf(buf, n);
}
}
#endif
/* Make sure that we start out with b at a 4-byte alignment; plenty