aboutsummaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/usbcom/usbcom.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/usbcom/usbcom.c b/sw/usbcom/usbcom.c
index 1568d88..a51bd6f 100644
--- a/sw/usbcom/usbcom.c
+++ b/sw/usbcom/usbcom.c
@@ -169,7 +169,7 @@ printResponse(libusb_device_handle *devh) {
while ((len = rxChars(devh, buf, sizeof(buf)-1)) >= 0) {
buf[len] = '\0';
printf("%s", buf);
- if (buf[len] == '\n') {
+ if (len > 0 && buf[len-1] == '\n') {
return;
}
}
@@ -192,4 +192,3 @@ main(int argc, char *argv[]) {
teardown(devh);
return 0;
}
-