From a29a3ac6f6bdfc2823462450edd28aa6cbbc5a9c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 26 Mar 2026 22:36:44 +0000 Subject: cleanup Signed-off-by: Leah Rowe --- util/libreboot-utils/lottery.c | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'util/libreboot-utils/lottery.c') diff --git a/util/libreboot-utils/lottery.c b/util/libreboot-utils/lottery.c index 9f84d043..9e396d1d 100644 --- a/util/libreboot-utils/lottery.c +++ b/util/libreboot-utils/lottery.c @@ -1,30 +1,20 @@ -/* SPDX-License-Identifier: MIT - * Copyright (c) 2026 Leah Rowe - */ +/* SPDX-License-Identifier: MIT ( >:3 ) + * Copyright (c) 2026 Leah Rowe /| |\ + / \*/ #include -#include -#include "include/common.h" -static int rigged(char **s); - -int -main(int argc, char *argv[]) -{ -#ifdef __OpenBSD__ - if (pledge("stdio", NULL) == -1) - err_no_cleanup(0, errno, "openbsd wins"); -#endif - printf("%s\n", (argc = rigged(argv)) ? "You lose!" : "You win!"); - return argc; -} - -static int -rigged(char **s) /* are u lucky? */ -{ +#include /* (^.>) - are u lucky? */ +#include "include/common.h" /* \| /= */ +static int rigged(char **s, int spew) { /* l \ */ size_t size[2] = { rsize(1 << 17), rsize(1 << 17) }; - - return !(size[0] && size[0] == size[1] && size[0] <= 1 << 18 && + spew &= size[1] = !(size[0] && size[0] == size[1] && size[0] <=1<<18 && s != NULL) || memcmp(*s = mkrbuf(size[0] << 1), *s + size[0], size[0]); -}/* ( >:3 ) - /| |\ it could be you! - / \ */ \ No newline at end of file + if (spew && !size[1]) printf("%s\n\n", *s); + return size[1]; +} /* (^:3) - it could be you! */ +int main(int argc, char **argv) { /* /| |l */ + xpledgex("stdio", NULL); /* / \ */ + printf("%s\n", (argc = rigged(argv, argc > 1))?"You lose!":"You win!"); + return argc; /* (^.^)/ - come again soon! */ +} /* /| | + / \ */ -- cgit v1.2.1