Ticket #75 (closed defect: fixed)
Opened 3 years ago
Last modified 20 months ago
[PATCH] Correctly check read() return code
| Reported by: | ludovicrousseau | Owned by: | segher |
|---|---|---|---|
| Milestone: | Component: | libusb-1.0 | |
| Keywords: | Cc: | ||
| Blocked By: | Blocks: |
Description
read(2) returns a ssize_t (signed) and not a size_t (unsigned) or int
Fix the compiler warning:
os/linux_usbfs.c: In function ‘sysfs_get_active_config’:
os/linux_usbfs.c:366: warning: comparison of unsigned expression < 0 is always false
Attachments
Change History
Changed 3 years ago by ludovicrousseau
comment:1 Changed 3 years ago by segher
- Owner set to segher
- Status changed from new to accepted
comment:2 Changed 20 months ago by Ludovic Rousseau <rousseau@…>
- Resolution set to fixed
- Status changed from accepted to closed
Note: See
TracTickets for help on using
tickets.
Looks good. It might be better still to only check for -1
though (which, incidentally, would work with size_t as well).