Skip to content

Commit

Permalink
bug: Incorrect use of UINT16_C() on an already defined macro
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vonericsen committed Oct 30, 2024
1 parent 5fa05ef commit aefff73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/drive_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
{
Expand Down

0 comments on commit aefff73

Please sign in to comment.