Core: correctly check usbi_read() returned value
authorChris Dickens <christopher.a.dickens@gmail.com>
Fri, 2 Aug 2013 09:33:41 +0000 (11:33 +0200)
committerLudovic Rousseau <ludovic.rousseau+github@gmail.com>
Fri, 2 Aug 2013 09:37:21 +0000 (11:37 +0200)
commit7dad81fe6167c7dc903f88f3d1878a2f65b91710
tree941c314cfa88072c1d300d8528347e9724c6d60d
parentfedc3631f88462d7dfa6af7fc1328b5675eea059
Core: correctly check usbi_read() returned value

For messages received on the hotplug pipe, the message was read via
usbi_read() (ssize_t) and compared against the size of the message
struct (size_t). usbi_read() returns -1 on an error condition, so some
systems can cast the ssize_t to size_t for the comparison, making it
equal to SIZE_MAX and causing the error check condition to incorrectly
evaluate to false.
libusb/io.c
libusb/version_nano.h