aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/libusb20_desc.c
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2015-07-20 16:15:56 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2015-07-20 16:15:56 +0000
commit5a5c6e994c6c6bbfe71f0a96374d6036617887b7 (patch)
tree9829c1756c8fd7a4e2c3938637000b09a2d8a248 /lib/libusb/libusb20_desc.c
parentd37cb73c7905e76f0053163e6af25b1812cc8e83 (diff)
downloadsrc-5a5c6e994c6c6bbfe71f0a96374d6036617887b7.tar.gz
src-5a5c6e994c6c6bbfe71f0a96374d6036617887b7.zip
libusb: Fix minor cast-qual warning.
Fix a warning triggered by the gcc + FORTIFY_SOURCE patches: In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type Submitted by: hselansky
Notes
Notes: svn path=/head/; revision=285720
Diffstat (limited to 'lib/libusb/libusb20_desc.c')
-rw-r--r--lib/libusb/libusb20_desc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libusb/libusb20_desc.c b/lib/libusb/libusb20_desc.c
index c5cfc9df1056..a40318246d00 100644
--- a/lib/libusb/libusb20_desc.c
+++ b/lib/libusb/libusb20_desc.c
@@ -137,15 +137,13 @@ libusb20_parse_config_desc(const void *config_desc)
* Make a copy of the config descriptor, so that the caller can free
* the inital config descriptor pointer!
*/
- ptr = (void *)(lub_endpoint + nendpoint);
- memcpy(LIBUSB20_ADD_BYTES(ptr, 0), config_desc, pcdesc.len);
+ memcpy((void *)(lub_endpoint + nendpoint), config_desc, pcdesc.len);
+
+ ptr = (const void *)(lub_endpoint + nendpoint);
pcdesc.ptr = LIBUSB20_ADD_BYTES(ptr, 0);
- config_desc = LIBUSB20_ADD_BYTES(ptr, 0);
/* init config structure */
- ptr = config_desc;
-
LIBUSB20_INIT(LIBUSB20_CONFIG_DESC, &lub_config->desc);
if (libusb20_me_decode(ptr, ptr[0], &lub_config->desc)) {