diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-06-08 01:51:41 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-06-08 01:51:41 +0200 |
commit | 4f698ec642547534bac2b37f96de045dd828fd58 (patch) | |
tree | 3da7865b6e61994fbd49c6589ffd782df41f4f0e | |
parent | ce0a906e96afc33589743f9afb5ca28ca959cfed (diff) |
Fix some undefined behavior
-rw-r--r-- | src/main.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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); |