From 10ecf32e33ca6a099dd9fe206e070584eb62b629 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 26 Mar 2026 09:32:11 +0000 Subject: libreboot-utils: improved randomness test and the module bias handling is fully correct Signed-off-by: Leah Rowe --- util/libreboot-utils/lottery.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'util/libreboot-utils/lottery.c') 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 -#include #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 ) -- cgit v1.2.1