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;
|
return 1;
|
||||||
}
|
}
|
||||||
file = fopen(argv[1],"r");
|
file = fopen(argv[1],"r");
|
||||||
|
if (file == NULL) {
|
||||||
|
fprintf(stderr,"Unable to open file.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
struct SyntaxElement* code = parse(file);
|
struct SyntaxElement* code = parse(file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
if (code == NULL) {
|
if (code == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user