From ccd644af7e5564628bb0fe11afc790401d145e84 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 7 Jan 2015 21:48:07 -0500 Subject: [PATCH] common: more debug fixes. --- backend_common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend_common.c b/backend_common.c index a26e79e..61d9885 100644 --- a/backend_common.c +++ b/backend_common.c @@ -27,7 +27,7 @@ #include "backend_common.h" -#define BACKEND_VERSION "0.52" +#define BACKEND_VERSION "0.53" #ifndef URI_PREFIX #error "Must Define URI_PREFIX" #endif @@ -190,7 +190,8 @@ int read_data(struct libusb_device_handle *dev, uint8_t endp, DEBUG("<- "); while(i > 0) { - if (i % 16 == 0 && i != *readlen) { + if ((*readlen-i) != 0 && + (*readlen-i) % 16 == 0) { DEBUG2("\n"); DEBUG(" "); } @@ -225,7 +226,8 @@ int send_data(struct libusb_device_handle *dev, uint8_t endp, DEBUG("-> "); while(i > 0) { - if (i % 16 == 0 && i != num) { + if ((num-i) != 0 && + (num-i) % 16 == 0) { DEBUG2("\n"); DEBUG(" "); }