diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-07-11 13:33:42 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-07-11 13:33:42 +0100 |
commit | fec2f4d9d1989feb0290dfcff416385ec4b97586 (patch) | |
tree | 6098d2f8c80cabe776ca0a8c6f24233906573844 /comp/lucas-standen-NEA/code/global | |
parent | 3d0db47fa403229bced868f0b59e024b95cd19b6 (diff) |
finished vars, started work on the final zpy executable, still need to fix the parser though
Diffstat (limited to 'comp/lucas-standen-NEA/code/global')
-rw-r--r-- | comp/lucas-standen-NEA/code/global/util.c | 4 | ||||
-rw-r--r-- | comp/lucas-standen-NEA/code/global/util.h | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/comp/lucas-standen-NEA/code/global/util.c b/comp/lucas-standen-NEA/code/global/util.c index 5f41dbc..dff05da 100644 --- a/comp/lucas-standen-NEA/code/global/util.c +++ b/comp/lucas-standen-NEA/code/global/util.c @@ -104,7 +104,9 @@ Vdef *isVdef(char *str){ Vdef *out = CheckedMalloc(sizeof(Vdef)); char *type; - out->id = strtok(str, ":"); + char *tmp = strtok(str, ":"); + out->id = CheckedMalloc(strlen(tmp)+1); + memcpy(out->id, tmp, strlen(tmp)+1); type = strtok(NULL, ":"); if (strcmp(type, "i64") == 0) out->type = TI64; diff --git a/comp/lucas-standen-NEA/code/global/util.h b/comp/lucas-standen-NEA/code/global/util.h index dc59460..130f823 100644 --- a/comp/lucas-standen-NEA/code/global/util.h +++ b/comp/lucas-standen-NEA/code/global/util.h @@ -1,11 +1,3 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <stdbool.h> -#include <errno.h> -#include <error.h> -#include <ctype.h> - // functions for user void Die(); // brings down the program |