Ensure allocLength is defined when needed in onReadBuffer

This commit is contained in:
Sam Edwards 2023-08-10 16:57:06 -07:00
parent 9e746ba145
commit d67fa80cf0
No known key found for this signature in database
GPG Key ID: 7E45576E3D00CD64
1 changed files with 3 additions and 1 deletions

View File

@ -1936,6 +1936,9 @@ byte onReadBuffer(SCSI_DEVICE *dev, const byte *cdb)
{
byte mode = cdb[1] & 7;
unsigned m_scsi_buf_size = 0;
#if DEBUG > 0
uint32_t allocLength = ((uint32_t)cdb[6] << 16) | ((uint32_t)cdb[7] << 8) | cdb[8];
#endif
LOGN("-ReadBuffer");
LOGHEXN(mode);
@ -1955,7 +1958,6 @@ byte onReadBuffer(SCSI_DEVICE *dev, const byte *cdb)
writeDataPhase(4 + m_scsi_buf_size, m_buf);
#if DEBUG > 0
uint32_t allocLength = ((uint32_t)cdb[6] << 16) | ((uint32_t)cdb[7] << 8) | cdb[8];
for (unsigned i = 0; i < allocLength; i++) {
LOGHEX(m_scsi_buf[i]);LOG(" ");
}