From 1e04a7ab0dbe4f728b5a66715c6a5eb9df7f9b55 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Wed, 7 Feb 2024 00:34:45 +0000 Subject: [PATCH] CMD_LINE: Fixed handling of missing input file --- main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.c b/main.c index 7a2450a..7955f76 100644 --- a/main.c +++ b/main.c @@ -72,6 +72,11 @@ int main(int argc, char* argd[] ){ /// READ INPUT FILE /// FILE* rom=fopen(infile,"r"); + if(!rom){ + printf("Couldn't open input file %s\n",infile); + return 1; + } + struct simdata_t *simdata = init_simdata(); if(!simdata){ printf("Couldn't allocate memory\n");