diff options
author | Nicholas Corgan <nick.corgan@ettus.com> | 2013-11-19 15:40:41 -0800 |
---|---|---|
committer | Nicholas Corgan <nick.corgan@ettus.com> | 2013-11-19 15:40:41 -0800 |
commit | 60108e3ca8fdab91d9e0e133c96f3e06916ac934 (patch) | |
tree | cb4e3a3c56803e157d7aa3ccf6232f73eae524d5 /host/utils | |
parent | a764d4b3bfd2165b34fb1bf46bc739587e479600 (diff) | |
download | uhd-60108e3ca8fdab91d9e0e133c96f3e06916ac934.tar.gz uhd-60108e3ca8fdab91d9e0e133c96f3e06916ac934.tar.bz2 uhd-60108e3ca8fdab91d9e0e133c96f3e06916ac934.zip |
b2xx_fx3_utils: more validation before trying to load
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/b2xx_fx3_utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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); |