X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fjtag%2Fdrivers%2Fstlink_usb.c;h=60a2c319f548c3ec2abcb112a601ccb2114b999c;hb=87c90393fedc8bb278d189aa53bcd93f4892012b;hp=73169e1e4866c75aa57896d402f6a8e32aa0a651;hpb=faaa42283f5c06830fe997b80d6c64f6469c6cf0;p=openocd.git diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index 73169e1e48..60a2c319f5 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -35,6 +35,7 @@ /* project specific includes */ #include #include +#include #include #include #include @@ -1967,7 +1968,7 @@ static int stlink_usb_trace_read(void *handle, uint8_t *buf, size_t *size) return res; size_t bytes_avail = le_to_h_u16(h->databuf); - *size = bytes_avail < *size ? bytes_avail : *size - 1; + *size = bytes_avail < *size ? bytes_avail : *size; if (*size > 0) { res = stlink_usb_read_trace(handle, buf, *size); @@ -3016,7 +3017,7 @@ static int stlink_close(void *handle) * based on the length (0x1a = 26) we could easily decide if we have to fixup the serial * and then we have just to convert the raw data into printable characters using sprintf */ -static char *stlink_usb_get_alternate_serial(libusb_device_handle *device, +static char *stlink_usb_get_alternate_serial(struct libusb_device_handle *device, struct libusb_device_descriptor *dev_desc) { int usb_retval;