diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-25 23:53:51 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:42 +0000 |
| commit | b84c929e64f2398e02dc4ae9575d7b616fb18528 (patch) | |
| tree | 06fd82760d3c65c93730efb0f95c190c753a2c9e /util/libreboot-utils/lib | |
| parent | e0319f0116629f946fe286c5969f4a8a0dcfb7cb (diff) | |
rmalloc
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib')
| -rw-r--r-- | util/libreboot-utils/lib/rand.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 29a756ed..6fb25d9d 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -71,6 +71,16 @@ #define ELOTTERY ECANCELED +void * +rmalloc(size_t *rval) +{ + if (if_err(rval == NULL, EFAULT)) + return NULL; + + rset(rval, sizeof(*rval)); + return mkrstr(*rval %= BUFSIZ); +} + int win_lottery(void) { |
