Skip to content

Commit

Permalink
descriptor: Small clarifications with no behaviour change
Browse files Browse the repository at this point in the history
All the right hand side is `dev_cap`, change one outlier to match.

Also clarify the relationships between some magic numbers.

No change in behaviour here.
  • Loading branch information
seanm authored and tormodvolden committed May 28, 2024
1 parent 016a0de commit 678c812
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libusb/descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,11 +1208,11 @@ int API_EXPORTED libusb_get_platform_descriptor(libusb_context *ctx,
_platform_descriptor->bReserved = dev_cap->dev_capability_data[0];
memcpy(_platform_descriptor->PlatformCapabilityUUID, &(dev_cap->dev_capability_data[1]), 16);

/* Capability data is located after reserved byte and 128-bit UUID */
/* Capability data is located after reserved byte and 16 byte UUID */
uint8_t* capability_data = dev_cap->dev_capability_data + 1 + 16;

/* Capability data length is total descriptor length minus initial fields */
size_t capability_data_length = _platform_descriptor->bLength - (16 + 4);
size_t capability_data_length = dev_cap->bLength - (3 + 1 + 16);

memcpy(_platform_descriptor->CapabilityData, capability_data, capability_data_length);

Expand Down
2 changes: 1 addition & 1 deletion libusb/version_nano.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define LIBUSB_NANO 11910
#define LIBUSB_NANO 11911

0 comments on commit 678c812

Please sign in to comment.