aboutsummaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-09-05 18:28:21 -0400
committerSam Anthony <sam@samanthony.xyz>2025-09-05 18:28:21 -0400
commit2aa9d6e2ef1294d42c742a9ce7b6e3eb88316f4e (patch)
treed0ae3137fff3f8e79ed6ba71a4a8e53e672f821b /sw
parentce7f1a7f7aa0dbdc8d4ae1536db8f9605b4e4702 (diff)
downloadcan-gauge-interface-2aa9d6e2ef1294d42c742a9ce7b6e3eb88316f4e.zip
fix bug in usbcom
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;
}
-