]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
scsi: Fix if-statements in getmsglen()
authorThomas Huth <huth@tuxfamily.org>
Sat, 1 Dec 2018 12:08:44 +0000 (13:08 +0100)
committerThomas Huth <huth@tuxfamily.org>
Sat, 1 Dec 2018 12:08:44 +0000 (13:08 +0100)
The (msg >= 0x02 && msg <= 0x1f) condition is already handled by the
first if-statement, so the second if-statement is simply dead code.

scsi.cpp

index c060d641a458e3b3ced8d0750491a11750ee15fc..51e6a4e74109e141b4b75a0db54bd599109da6d0 100644 (file)
--- a/scsi.cpp
+++ b/scsi.cpp
@@ -1241,10 +1241,8 @@ static int getmsglen(uae_u8 *msgp, int len)
        uae_u8 msg = msgp[0];
        if (msg == 0 || (msg >= 0x02 && msg <= 0x1f) ||msg >= 0x80)
                return 1;
-       if (msg >= 0x02 && msg <= 0x1f)
-               return 2;
        if (msg >= 0x20 && msg <= 0x2f)
-               return 3;
+               return 2;
        // extended message, at least 3 bytes
        if (len < 2)
                return 3;