Fix up frequency list size

This commit is contained in:
Mike Walters
2016-09-11 15:52:29 +01:00
parent c127cdc0a4
commit f7cd712ff9
2 changed files with 4 additions and 3 deletions

View File

@@ -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;