Update error handling inside extlibs

This commit is contained in:
2026-01-18 21:37:46 +11:00
parent 72162a7410
commit 754b63fb75
5 changed files with 42 additions and 112 deletions

View File

@@ -562,7 +562,8 @@ GroundError createGroundError(char* what, char* type, GroundInstruction* where,
ge.type = malloc(strlen(type) + 1);
strcpy(ge.type, type);
} else {
ge.type = "GenericError";
ge.type = malloc(strlen("GenericError") + 1);
strcpy(ge.type, "GenericError");
}
if (where != NULL) {
@@ -575,7 +576,8 @@ GroundError createGroundError(char* what, char* type, GroundInstruction* where,
if (line != NULL) {
ge.line = *line;
} else {
ge.line = -1;
ge.line = 0;
ge.hasLine = false;
}
return ge;