From 771de3c24d2dc302a47661399f1a1fa606210167 Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Fri, 22 Feb 2013 21:39:03 -0700 Subject: [PATCH] more fixes for bytes transferred checks --- host/libhackrf/src/hackrf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host/libhackrf/src/hackrf.c b/host/libhackrf/src/hackrf.c index 716f9baa..3f0815ed 100644 --- a/host/libhackrf/src/hackrf.c +++ b/host/libhackrf/src/hackrf.c @@ -453,7 +453,7 @@ int hackrf_spiflash_write(hackrf_device* device, const uint32_t address, 0 ); - if( result != 0 ) { + if (result < length) { return HACKRF_ERROR_LIBUSB; } else { return HACKRF_SUCCESS; @@ -478,7 +478,7 @@ int hackrf_spiflash_read(hackrf_device* device, const uint32_t address, 0 ); - if( result < 2 ) { + if (result < length) { return HACKRF_ERROR_LIBUSB; } else { return HACKRF_SUCCESS; @@ -499,7 +499,7 @@ int hackrf_cpld_write(hackrf_device* device, const uint16_t length, 0 ); - if( result != 0 ) { + if (result < length) { return HACKRF_ERROR_LIBUSB; } else { return HACKRF_SUCCESS;