Check if file was opened successfuly
This commit is contained in:
parent
f44429ce5d
commit
512a86ed48
@ -14,6 +14,10 @@ int main(int argc, char *argv[]) {
|
||||
return 1;
|
||||
}
|
||||
file = fopen(argv[1],"r");
|
||||
if (file == NULL) {
|
||||
fprintf(stderr,"Unable to open file.\n");
|
||||
return 1;
|
||||
}
|
||||
struct SyntaxElement* code = parse(file);
|
||||
fclose(file);
|
||||
if (code == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user