mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
Fix crash when rtlsdr_open fails
This commit is contained in:
parent
7a01c436d6
commit
2a95d05631
@ -41,8 +41,12 @@ int SDRThread::enumerate_rtl(std::vector<SDRDeviceInfo *> *devs) {
|
||||
deviceProduct = product;
|
||||
deviceManufacturer = manufact;
|
||||
|
||||
rtlsdr_dev_t *devTest;
|
||||
rtlsdr_open(&devTest, i);
|
||||
rtlsdr_dev_t *devTest = nullptr;
|
||||
if(rtlsdr_open(&devTest, i) < 0)
|
||||
{
|
||||
std::cout << "\tFailed to open device " << i << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
std::cout << "\t Tuner type: ";
|
||||
switch (rtlsdr_get_tuner_type(devTest)) {
|
||||
|
Loading…
Reference in New Issue
Block a user