From 3ecff9bcc65b707e5fa2c4bfb29aa7a934f0ce30 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Sun, 15 Oct 2017 12:48:44 +0200 Subject: [PATCH] ConvertObj: check command line args (fixes #34) --- ConvertObj/ConvertObj.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ConvertObj/ConvertObj.cc b/ConvertObj/ConvertObj.cc index 7c15248129..7fb59121cd 100644 --- a/ConvertObj/ConvertObj.cc +++ b/ConvertObj/ConvertObj.cc @@ -219,7 +219,18 @@ void sortModules(std::vector>& modules) int main(int argc, char* argv[]) { + if(argc != 2) + { + std::cerr << "Usage: ConvertOBJ mpw.o > retro68.s\n"; + return 1; + } std::ifstream in(argv[1]); + if(!in) + { + std::cerr << "Could not read imput file \"" << argv[1] << "\"\n"; + std::cerr << "Usage: ConvertOBJ mpw.o > retro68.s\n"; + return 1; + } unordered_map stringDictionary;