usb_midi: Fix 32 bit build.

This commit is contained in:
Michael Lotz 2020-05-05 21:23:44 +02:00
parent 9792465ec1
commit 1705082fa2

View File

@ -652,9 +652,10 @@ usb_midi_write(driver_cookie* cookie, off_t position,
// TODO add a loop to allow writing multiple events in a single write()
// call if desired.
if (midicode != 0xF0) {
if (*num_bytes < CINbytes[cin]) {
DPRINTF_ERR((MY_ID "Expected %d bytes for MIDI command %x but got "
"only %d.\n", CINbytes[cin], cin, *num_bytes));
if ((int)*num_bytes < CINbytes[cin]) {
DPRINTF_ERR((MY_ID "Expected %d bytes for MIDI command %" B_PRIu8
" but got only %" B_PRIuSIZE ".\n", CINbytes[cin], cin,
*num_bytes));
return B_BAD_DATA;
}
*num_bytes = CINbytes[cin];