aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-08 01:51:41 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-08 01:51:41 +0200
commit4f698ec642547534bac2b37f96de045dd828fd58 (patch)
tree3da7865b6e61994fbd49c6589ffd782df41f4f0e /src
parentce0a906e96afc33589743f9afb5ca28ca959cfed (diff)
Fix some undefined behavior
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files 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);