mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-14 03:08:56 +01:00
Fix up frequency list size
This commit is contained in:
@@ -1702,6 +1702,7 @@ int ADDCALL hackrf_init_sweep(hackrf_device* device,
|
||||
int length)
|
||||
{
|
||||
int result, i;
|
||||
int size = length * sizeof(frequency_list[0]);
|
||||
|
||||
for(i=0; i<length; i++)
|
||||
frequency_list[i] = TO_LE(frequency_list[i]);
|
||||
@@ -1713,11 +1714,11 @@ int ADDCALL hackrf_init_sweep(hackrf_device* device,
|
||||
0,
|
||||
0,
|
||||
(unsigned char*)frequency_list,
|
||||
length,
|
||||
size,
|
||||
0
|
||||
);
|
||||
|
||||
if (result < length) {
|
||||
if (result < size) {
|
||||
return HACKRF_ERROR_LIBUSB;
|
||||
} else {
|
||||
return HACKRF_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user