]> granicus.if.org Git - libevent/commitdiff
Fix a compiler warning when checking for arc4random_buf linker breakage.
authorNick Mathewson <nickm@torproject.org>
Thu, 19 Sep 2013 14:43:54 +0000 (10:43 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 19 Sep 2013 14:43:54 +0000 (10:43 -0400)
Patch by Ralph Castain.

evutil_rand.c

index 3c2c81de4250f1bb610abeaf4e9a679be777d29c..4df685cacb6f2adaacf8bb3dd7376e4959fc7775 100644 (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