From 4f698ec642547534bac2b37f96de045dd828fd58 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 8 Jun 2024 01:51:41 +0200 Subject: Fix some undefined behavior --- src/main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 23b0471..2e6011b 100644 --- a/src/main.c +++ b/src/main.c @@ -21,16 +21,14 @@ main(int argc, char **argv) struct { char *p; size_t len; - } file = { - .p = readfile(argv[1], &file.len), - }; + } file; + file.p = readfile(argv[1], &file.len); struct { struct lexeme *p; size_t len; - } toks = { - .p = lexstring(file.p, file.len, &toks.len), - }; + } toks; + toks.p = lexstring(file.p, file.len, &toks.len); #if DEBUG free(file.p); -- cgit v1.2.3