diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-26 09:32:11 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 10:52:11 +0000 |
| commit | 10ecf32e33ca6a099dd9fe206e070584eb62b629 (patch) | |
| tree | 1e6f9374bcef7933afcfa6bdaa0af80f6f93ce09 /util/libreboot-utils/lottery.c | |
| parent | 8e8f7bced44c5f61e390e81d8a84a93099358453 (diff) | |
libreboot-utils: improved randomness test
and the module bias handling is fully correct
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lottery.c')
| -rw-r--r-- | util/libreboot-utils/lottery.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/util/libreboot-utils/lottery.c b/util/libreboot-utils/lottery.c index 8157d7a9..4c3b0f70 100644 --- a/util/libreboot-utils/lottery.c +++ b/util/libreboot-utils/lottery.c @@ -7,15 +7,12 @@ #endif #include <stdio.h> -#include <stdlib.h> #include "include/common.h" int main(int argc, char *argv[]) { - char *s1 = NULL; - int rval = 0; - + int lucky; #if defined(__OpenBSD__) && defined(OpenBSD) #if (OpenBSD) >= 509 if (pledge("stdio", NULL) == -1) @@ -24,16 +21,10 @@ main(int argc, char *argv[]) #endif setvbuf(stdout, NULL, _IONBF, 0); - if (win_lottery(&s1)) - rval = 1; - - if (s1 != NULL) { - printf("%s\n\n", s1); - free(s1); - } + lucky = win_lottery(); - printf("%s\n", rval ? "You won!" : "You lose! Sorry!"); - return rval? EXIT_SUCCESS : EXIT_FAILURE; + printf("%s\n", lucky ? "You won!" : "You lose! Sorry!"); + return lucky ? EXIT_SUCCESS : EXIT_FAILURE; }/* ( >:3 ) |
