mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-23 04:08:36 -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;
|
deviceProduct = product;
|
||||||
deviceManufacturer = manufact;
|
deviceManufacturer = manufact;
|
||||||
|
|
||||||
rtlsdr_dev_t *devTest;
|
rtlsdr_dev_t *devTest = nullptr;
|
||||||
rtlsdr_open(&devTest, i);
|
if(rtlsdr_open(&devTest, i) < 0)
|
||||||
|
{
|
||||||
|
std::cout << "\tFailed to open device " << i << std::endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "\t Tuner type: ";
|
std::cout << "\t Tuner type: ";
|
||||||
switch (rtlsdr_get_tuner_type(devTest)) {
|
switch (rtlsdr_get_tuner_type(devTest)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user