Skip to content

Commit

Permalink
disasm: Error message in case provided file cannot be opened
Browse files Browse the repository at this point in the history
  • Loading branch information
klei1984 authored and mefistotelis committed Jan 8, 2024
1 parent 23fa96a commit 148bce4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/swdisasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,11 @@ main (int argc, char **argv)
}

ifs.open (argv[1], std::ios::binary);
if(!ifs.is_open()) {
std::cerr << "Error opening file: " << argv[1];
return 1;
}

le = LinearExecutable::load (&ifs, argv[1]);

image = create_image (&ifs, le);
Expand Down

0 comments on commit 148bce4

Please sign in to comment.