CMD_LINE: Fixed handling of missing input file

This commit is contained in:
(Tim) Efthimis Kritikos 2024-02-07 00:34:45 +00:00
parent 4402688a20
commit 1e04a7ab0d

5
main.c
View File

@ -72,6 +72,11 @@ int main(int argc, char* argd[] ){
/// READ INPUT FILE /// /// READ INPUT FILE ///
FILE* rom=fopen(infile,"r"); FILE* rom=fopen(infile,"r");
if(!rom){
printf("Couldn't open input file %s\n",infile);
return 1;
}
struct simdata_t *simdata = init_simdata(); struct simdata_t *simdata = init_simdata();
if(!simdata){ if(!simdata){
printf("Couldn't allocate memory\n"); printf("Couldn't allocate memory\n");