commit | 7dad81fe6167c7dc903f88f3d1878a2f65b91710 | [log] [tgz] |
---|---|---|
author | Chris Dickens <christopher.a.dickens@gmail.com> | Fri Aug 02 11:33:41 2013 +0200 |
committer | Ludovic Rousseau <ludovic.rousseau+github@gmail.com> | Fri Aug 02 11:37:21 2013 +0200 |
tree | 941c314cfa88072c1d300d8528347e9724c6d60d | |
parent | fedc3631f88462d7dfa6af7fc1328b5675eea059 [diff] |
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.