From aefff734866308af17a56ff4218cca29186010cb Mon Sep 17 00:00:00 2001 From: Tyler Erickson Date: Wed, 30 Oct 2024 13:32:34 -0600 Subject: [PATCH] bug: Incorrect use of UINT16_C() on an already defined macro UINT16_C() should only be used on numeric values, not on already defined values. This causes a bug in other systems where this macro appends something to the end of the numeric value upon expansion. This issue was reported from a user with smartos [Seagate/openSeaChest#167] Signed-off-by: Tyler Erickson --- src/drive_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drive_info.c b/src/drive_info.c index 1879689..7f4b898 100644 --- a/src/drive_info.c +++ b/src/drive_info.c @@ -1909,7 +1909,7 @@ static eReturnValues get_ATA_Drive_Info_From_ID_Data_Log(ptrDriveInformationSAS_ bool dlcEnabled = false; bool cdlSupported = false; bool cdlEnabled = false; - for (uint16_t iter = ATA_ID_DATA_SUP_PG_LIST_OFFSET; iter < C_CAST(uint16_t, listLen + ATA_ID_DATA_SUP_PG_LIST_OFFSET) && iter < UINT16_C(ATA_LOG_PAGE_LEN_BYTES); ++iter) + for (uint16_t iter = ATA_ID_DATA_SUP_PG_LIST_OFFSET; iter < C_CAST(uint16_t, listLen + ATA_ID_DATA_SUP_PG_LIST_OFFSET) && iter < ATA_LOG_PAGE_LEN_BYTES; ++iter) { switch (idDataLog[iter]) {