From 8b04120a8fdd80992d80acf81e1be966a55a3044 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Sat, 1 Dec 2018 13:08:44 +0100 Subject: [PATCH] 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. --- scsi.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; -- 2.47.3