]> granicus.if.org Git - libevent/commitdiff
Correctly check for arc4random_buf
authorSebastian Hahn <sebastian@torproject.org>
Fri, 1 Jun 2012 03:23:29 +0000 (05:23 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Fri, 1 Jun 2012 03:23:29 +0000 (05:23 +0200)
Apparently it's necssary to do an explicit comparison with NULL here.
This also gets rid of a compile warning

evutil_rand.c

index e2bf605f3d6d4902d6fb4d39ea140f2d7412f166..b66d88b47ca3858c7c4dae9be68ccd1dbeec1342 100644 (file)
@@ -70,7 +70,7 @@ ev_arc4random_buf(void *buf, size_t n)
         * and fall back otherwise.  (OSX does this using some linker
         * trickery.)
         */
-       if (arc4random_buf) {
+       if (arc4random_buf != NULL) {
                return arc4random_buf(buf, n);
        }
 #endif