diff options
author | Ludovic Rousseau <ludovic.rousseau+github@gmail.com> | 2013-04-04 18:08:39 +0200 |
---|---|---|
committer | Ludovic Rousseau <ludovic.rousseau+github@gmail.com> | 2013-04-04 18:08:39 +0200 |
commit | fed4f7e47f49523c6a9469a2b25c7d995b1ebcd6 (patch) | |
tree | 4a8110345c2604c23a87bfb5b156d54334d58129 | |
parent | aa94d3e43b2a4b434a7705dd1f2d7622c602687d (diff) | |
download | libusb-fed4f7e47f49523c6a9469a2b25c7d995b1ebcd6.tar.gz |
Core: fix bug in libusb_has_capability()
The problem was detected by clang on Mac OS X:
warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
note: use '&' for a bitwise operation
We want to use a bitwise operation and not a logical operation.
-rw-r--r-- | libusb/core.c | 4 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libusb/core.c b/libusb/core.c index e2da1ea..5948689 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -1752,9 +1752,9 @@ int API_EXPORTED libusb_has_capability(uint32_t capability) case LIBUSB_CAP_HAS_CAPABILITY: return 1; case LIBUSB_CAP_HAS_HID_ACCESS: - return (usbi_backend->caps && USBI_CAP_HAS_HID_ACCESS); + return (usbi_backend->caps & USBI_CAP_HAS_HID_ACCESS); case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: - return (usbi_backend->caps && USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER); + return (usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER); } return 0; } diff --git a/libusb/version_nano.h b/libusb/version_nano.h index c366ce0..b2dd2b4 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10638 +#define LIBUSB_NANO 10639 |