From 52cfdaa2d2c1f7cd494cf7ca40f6d6eeef665fe7 Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Tue, 12 Mar 2019 13:05:21 -0700 Subject: [PATCH] Fix signed/unsigned bug. --- src/usb/msc_uf2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usb/msc_uf2.c b/src/usb/msc_uf2.c index 4f9109a..fb0f41d 100644 --- a/src/usb/msc_uf2.c +++ b/src/usb/msc_uf2.c @@ -63,7 +63,7 @@ int write_block(uint32_t block_no, uint8_t *data, bool quiet, WriteState *state) int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize) { void const* response = NULL; - uint16_t resplen = 0; + int32_t resplen = 0; switch ( scsi_cmd[0] ) { @@ -98,7 +98,7 @@ int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, } // return len must not larger than bufsize - if ( resplen > bufsize ) resplen = bufsize; + if ( resplen > (int32_t)bufsize ) resplen = bufsize; // copy response to stack's buffer if any if ( response && resplen )