Skip to content

Commit

Permalink
Merge pull request #251 from dotsam/fix-debug
Browse files Browse the repository at this point in the history
Ensure allocLength is defined when needed in onReadBuffer
  • Loading branch information
erichelgeson authored Aug 11, 2023
2 parents 9e746ba + d67fa80 commit 810eae9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BlueSCSI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(" ");
}
Expand Down

0 comments on commit 810eae9

Please sign in to comment.