Skip to content

Commit 52cfdaa

Browse files
committed
Fix signed/unsigned bug.
1 parent 4ea74d4 commit 52cfdaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/usb/msc_uf2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int write_block(uint32_t block_no, uint8_t *data, bool quiet, WriteState *state)
6363
int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize)
6464
{
6565
void const* response = NULL;
66-
uint16_t resplen = 0;
66+
int32_t resplen = 0;
6767

6868
switch ( scsi_cmd[0] )
6969
{
@@ -98,7 +98,7 @@ int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer,
9898
}
9999

100100
// return len must not larger than bufsize
101-
if ( resplen > bufsize ) resplen = bufsize;
101+
if ( resplen > (int32_t)bufsize ) resplen = bufsize;
102102

103103
// copy response to stack's buffer if any
104104
if ( response && resplen )

0 commit comments

Comments
 (0)