Skip to content

Commit

Permalink
Fix Sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Oct 24, 2024
1 parent b0c941d commit c881ae9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cpp/devices/tape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,14 @@ void Tape::Space6()
if (tar_mode) {
switch (code) {
case object_type::BLOCK:
position += count * GetBlockSize();
block_location += count;
if (block_location + count >= 0) {
position += count * GetBlockSize();
block_location += count;
}
else {
position = 0;
block_location = 0;
}
break;

case object_type::END_OF_DATA:
Expand All @@ -424,13 +430,6 @@ void Tape::Space6()
throw scsi_exception(sense_key::illegal_request, asc::invalid_command_operation_code);
}

if (position < 0) {
position = 0;
}
if (block_location < 0) {
block_location = 0;
}

StatusPhase();

return;
Expand Down

0 comments on commit c881ae9

Please sign in to comment.