aboutsummaryrefslogtreecommitdiffstats
path: root/src/librandom/unirandom_readb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/librandom/unirandom_readb.c')
-rw-r--r--src/librandom/unirandom_readb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librandom/unirandom_readb.c b/src/librandom/unirandom_readb.c
new file mode 100644
index 0000000..cbe45a6
--- /dev/null
+++ b/src/librandom/unirandom_readb.c
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/unirandom.h>
+
+unsigned int unirandom_readb (unirandom_ref u, char *s, unsigned int n)
+{
+ if (!u->initted && !unirandom_init(u)) return 0 ;
+ return (*u->readb)(&u->data, s, n) ;
+}