diff --git a/olimex.c b/olimex.c index acf63d7..46b4da4 100644 --- a/olimex.c +++ b/olimex.c @@ -272,7 +272,7 @@ transport_t olimex_open(const char *devpath, const char *requested_serial) /* Flush out lingering data */ while (usb_bulk_read(tr->handle, tr->in_ep, buf, sizeof(buf), - 100) >= 0); + 100) > 0); return (transport_t)tr; } diff --git a/rf2500.c b/rf2500.c index c3772e3..05007e4 100644 --- a/rf2500.c +++ b/rf2500.c @@ -231,7 +231,7 @@ transport_t rf2500_open(const char *devpath, const char *requested_serial) #ifndef __APPLE__ while (usb_bulk_read(tr->handle, USB_FET_IN_EP, buf, sizeof(buf), - 100) >= 0); + 100) > 0); #endif return (transport_t)tr;