diff options
Diffstat (limited to 'comp/lucas-standen-NEA/code/global/util.c')
-rw-r--r-- | comp/lucas-standen-NEA/code/global/util.c | 4 |
1 files changed, 3 insertions, 1 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; |