summaryrefslogtreecommitdiff
path: root/examples/xusb.c
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-04-08 12:40:54 +0100
committerPete Batard <pbatard@gmail.com>2010-04-08 12:40:54 +0100
commit31aff02b62549a3c47daea6f0093124cb8bfae7c (patch)
tree3838260103578a463011bb8290ef7e2f509c9791 /examples/xusb.c
parentc1cea1b0fe97dc21aebf7db2167c40cbf3586546 (diff)
downloadlibusb-31aff02b62549a3c47daea6f0093124cb8bfae7c.tar.gz
fixed "ignoring return value of 'fwrite'" warning with gccr247
Diffstat (limited to 'examples/xusb.c')
-rw-r--r--examples/xusb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index 1b56d35..fdb6ecf 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -344,6 +344,7 @@ int test_mass_storage(libusb_device_handle *handle, uint8_t endpoint_in, uint8_t
char vid[9], pid[9], rev[5];
unsigned char *data;
FILE *fd;
+ size_t junk;
printf("Reading Max LUN:\n");
r = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,
@@ -420,7 +421,7 @@ int test_mass_storage(libusb_device_handle *handle, uint8_t endpoint_in, uint8_t
} else {
display_buffer_hex(data, size);
if ((binary_dump) && ((fd = fopen(binary_name, "w")) != NULL)) {
- fwrite(data, 1, size, fd);
+ junk = fwrite(data, 1, size, fd);
fclose(fd);
}
}
@@ -495,6 +496,7 @@ int test_hid(libusb_device_handle *handle, uint8_t endpoint_in)
uint8_t hid_report_descriptor[256];
uint8_t *report_buffer;
FILE *fd;
+ size_t junk;
printf("\nReading HID Report Descriptors:\n");
descriptor_size = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_STANDARD|LIBUSB_RECIPIENT_INTERFACE,
@@ -505,7 +507,7 @@ int test_hid(libusb_device_handle *handle, uint8_t endpoint_in)
} else {
display_buffer_hex(hid_report_descriptor, descriptor_size);
if ((binary_dump) && ((fd = fopen(binary_name, "w")) != NULL)) {
- fwrite(hid_report_descriptor, 1, descriptor_size, fd);
+ junk = fwrite(hid_report_descriptor, 1, descriptor_size, fd);
fclose(fd);
}
size = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_FEATURE);