more fixes for bytes transferred checks

This commit is contained in:
Michael Ossmann
2013-02-22 21:39:03 -07:00
parent 198857d516
commit 771de3c24d

View File

@ -453,7 +453,7 @@ int hackrf_spiflash_write(hackrf_device* device, const uint32_t address,
0 0
); );
if( result != 0 ) { if (result < length) {
return HACKRF_ERROR_LIBUSB; return HACKRF_ERROR_LIBUSB;
} else { } else {
return HACKRF_SUCCESS; return HACKRF_SUCCESS;
@ -478,7 +478,7 @@ int hackrf_spiflash_read(hackrf_device* device, const uint32_t address,
0 0
); );
if( result < 2 ) { if (result < length) {
return HACKRF_ERROR_LIBUSB; return HACKRF_ERROR_LIBUSB;
} else { } else {
return HACKRF_SUCCESS; return HACKRF_SUCCESS;
@ -499,7 +499,7 @@ int hackrf_cpld_write(hackrf_device* device, const uint16_t length,
0 0
); );
if( result != 0 ) { if (result < length) {
return HACKRF_ERROR_LIBUSB; return HACKRF_ERROR_LIBUSB;
} else { } else {
return HACKRF_SUCCESS; return HACKRF_SUCCESS;