Permalink
Browse files

patch by NIIBE Yutaka <gniibe@fsij.org>

  • Loading branch information...
1 parent 6c23957 commit f3e3efe0b7f86ad7acac825595b8ae6c64b1a98b Thomas Sailer committed Jan 17, 2006
Showing with 8 additions and 3 deletions.
  1. +5 −0 ChangeLog
  2. +3 −3 lsusb.c
View
@@ -1,3 +1,8 @@
+2006-01-17 NIIBE Yutaka <gniibe@fsij.org>
+ * lsusb.c (dump_hub): Format string fix.
+ (do_hub): Allocate enough space for the hub descriptor.
+ Check return value in different way.
+
2005-11-03 David Brownell <dbrownell@users.sourceforge.net>
* lsusb.c: better diagnostics: for invalid CDC descriptors of a
type we know, show that type with the message.
View
@@ -1652,7 +1652,7 @@ static void dump_hub(char *prefix, unsigned char *p, int has_tt)
printf(" 0x%02x", p[7+i]);
printf("\n%s PortPwrCtrlMask ", prefix);
for(j = 0; j < l; j++)
- printf(" 0x%02x ", p[7+i+j]);
+ printf(" 0x%02x", p[7+i+j]);
printf("\n");
}
@@ -2141,15 +2141,15 @@ dump_comm_descriptor(struct usb_dev_handle *dev, unsigned char *buf, char *inden
static void do_hub(struct usb_dev_handle *fd, unsigned has_tt)
{
- unsigned char buf [7];
+ unsigned char buf [12];
int i, ret;
ret = usb_control_msg(fd,
USB_ENDPOINT_IN | USB_TYPE_CLASS | USB_RECIP_DEVICE,
USB_REQ_GET_DESCRIPTOR,
0x29 << 8, 0,
buf, sizeof buf, CTRL_TIMEOUT);
- if (ret != sizeof buf) {
+ if (ret < 0) {
/* Linux returns this for suspended devices */
if (errno != EHOSTUNREACH)
perror ("can't get hub descriptor");

0 comments on commit f3e3efe

Please sign in to comment.