diff --git a/utils/mc_bin_to_flat_main.cpp b/utils/mc_bin_to_flat_main.cpp index 8cdca7f115..10084d9b88 100644 --- a/utils/mc_bin_to_flat_main.cpp +++ b/utils/mc_bin_to_flat_main.cpp @@ -21,6 +21,11 @@ int main(int argc, char * argv[]) usage(argv[0]); return 1; } + if(bfs::path(argv[1]).filename().extension().string() != ".bin") + { + mc_rtc::log::error("Input file name (\"{}\") should end with .bin", argv[1]); + return 1; + } std::string in = argv[1]; std::string out = ""; if(argc == 3) diff --git a/utils/mc_bin_to_log_main.cpp b/utils/mc_bin_to_log_main.cpp index dc1e7ecea9..eb28a14f03 100644 --- a/utils/mc_bin_to_log_main.cpp +++ b/utils/mc_bin_to_log_main.cpp @@ -21,6 +21,11 @@ int main(int argc, char * argv[]) usage(argv[0]); return 1; } + if(bfs::path(argv[1]).filename().extension().string() != ".bin") + { + mc_rtc::log::error("Input file name (\"{}\") should end with .bin", argv[1]); + return 1; + } std::string in = argv[1]; std::string out = ""; if(argc == 3)