forked from ground/cground
Update error handling inside extlibs
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user