From 60108e3ca8fdab91d9e0e133c96f3e06916ac934 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Tue, 19 Nov 2013 15:40:41 -0800 Subject: b2xx_fx3_utils: more validation before trying to load --- host/utils/b2xx_fx3_utils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index 01e1ea793..c182548b7 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -264,6 +264,16 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { if (fw_file.empty()) fw_file = uhd::find_image_path(B200_FW_FILE_NAME); + + if(fw_file.empty()) { + std::cerr << "Firmware image not found!" << std::endl; + return -1; + } + + if(!(fs::exists(fw_file))) { + std::cerr << "Invalid filepath: " << fw_file << std::endl; + return -1; + } // load firmware b200->load_firmware(fw_file); -- cgit v1.2.3