From: Thomas Huth Date: Sat, 1 Dec 2018 12:08:44 +0000 (+0100) Subject: scsi: Fix if-statements in getmsglen() X-Git-Tag: 4200~98^2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8b04120a8fdd80992d80acf81e1be966a55a3044;p=francis%2Fwinuae.git scsi: Fix if-statements in getmsglen() The (msg >= 0x02 && msg <= 0x1f) condition is already handled by the first if-statement, so the second if-statement is simply dead code. --- diff --git a/scsi.cpp b/scsi.cpp index c060d641..51e6a4e7 100644 --- 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;