From 4ce39e4fc1de9536de7dedfe91b6dee38dec76ae Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 1 Oct 2026 01:04:30 +0200 Subject: WIP sym + cgen --- src/prc1/prc1.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/prc1/prc1.c') diff --git a/src/prc1/prc1.c b/src/prc1/prc1.c index 2822cc5..634608b 100644 --- a/src/prc1/prc1.c +++ b/src/prc1/prc1.c @@ -41,7 +41,14 @@ int main(int argc, char *argv[]) fname = args.src; } - l.loc.f = fname; + if (!(l.loc.f = malloc(strlen(fname) + 1))) + { + perror("malloc(3)"); + goto end; + } + else + strcpy(l.loc.f, fname); + l.args = a.args = &args; if (lex(&l, f) || parse(&l, &a) || cgen(&a, &c)) -- cgit v1.2.3