diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2014-01-26 19:53:44 +0100 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2014-01-26 19:53:44 +0100 |
commit | 24f6f88a37fccd36aa05f08de3f7f4289ff0607c (patch) | |
tree | 793bc1fdd00cf694a876e87cc1a39579522db695 /lib/rfspace/rfspace_source_c.cc | |
parent | d960d1119cc39bbea25a23766c7b7d8d056a6bbd (diff) |
rfspace: properly cover the absense of a serial number
Diffstat (limited to 'lib/rfspace/rfspace_source_c.cc')
-rw-r--r-- | lib/rfspace/rfspace_source_c.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rfspace/rfspace_source_c.cc b/lib/rfspace/rfspace_source_c.cc index 7c1b0c6..7cba493 100644 --- a/lib/rfspace/rfspace_source_c.cc +++ b/lib/rfspace/rfspace_source_c.cc @@ -1124,7 +1124,7 @@ static std::string read_file(const char *filename) return contents; } - throw(errno); + return ""; } static std::vector < unit_t > discover_sdr_iq() @@ -1207,6 +1207,8 @@ static std::vector < unit_t > discover_sdr_iq() continue; std::string serial = read_file( (path + "/serial").c_str() ); + if ( serial.empty() ) + serial = "<none>"; pos = serial.find('\n'); if ( pos != std::string::npos ) |