summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2011-11-02 13:48:51 +0000
committerPete Batard <pete@akeo.ie>2011-11-02 13:48:51 +0000
commit46b86093e59336421c026d3f6aa8d5a41c6e00c0 (patch)
tree7811b33a56e6bfc37265f6e0c39f7c8ee5fe0d69
parentcf3b3dcdb7007694fac42c515b21bf9b0199856f (diff)
downloadlibusb-46b86093e59336421c026d3f6aa8d5a41c6e00c0.tar.gz
[xusb] fix Clang warning about unused variable
-rw-r--r--examples/xusb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index 0c794ca..1a176bd 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -440,7 +440,6 @@ 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,
@@ -516,7 +515,9 @@ 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)) {
- junk = fwrite(data, 1, (size_t)size, fd);
+ if (fwrite(data, 1, (size_t)size, fd) != size) {
+ perr(" unable to write binary data\n");
+ }
fclose(fd);
}
}