Skip to content

Commit

Permalink
bugfix: tools: punchboot: libusb_get_string_descriptor_ascii
Browse files Browse the repository at this point in the history
Returns length of the descriptor or a negative number.
  • Loading branch information
jonasblixt committed Dec 6, 2023
1 parent fbcebf9 commit 4b4910e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/punchboot/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int pb_usb_connect(struct pb_context *ctx)

pb_usb_close_handle(priv);

if (rc != 0)
if (rc < 0)
continue;

if (strcmp((char *)device_serial, priv->device_uuid) != 0)
Expand Down Expand Up @@ -206,7 +206,7 @@ static int pb_usb_list(struct pb_context *ctx,
rc = libusb_get_string_descriptor_ascii(
priv->h, desc.iSerialNumber, device_serial, sizeof(device_serial));

if (rc != 0)
if (rc < 0)
continue;

pb_usb_close_handle(priv);
Expand Down

0 comments on commit 4b4910e

Please sign in to comment.