mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 22:20:17 +01:00
Chore: introduce macro ARRAY_SIZE
This commit is contained in:
@@ -146,9 +146,9 @@ void ffPrintDisplay(FFDisplayOptions* options)
|
||||
if(result->refreshRate > 0)
|
||||
{
|
||||
if(options->preciseRefreshRate)
|
||||
snprintf(refreshRate, sizeof(refreshRate), "%g", ((int) (result->refreshRate * 1000 + 0.5)) / 1000.0);
|
||||
snprintf(refreshRate, ARRAY_SIZE(refreshRate), "%g", ((int) (result->refreshRate * 1000 + 0.5)) / 1000.0);
|
||||
else
|
||||
snprintf(refreshRate, sizeof(refreshRate), "%i", (uint32_t) (result->refreshRate + 0.5));
|
||||
snprintf(refreshRate, ARRAY_SIZE(refreshRate), "%i", (uint32_t) (result->refreshRate + 0.5));
|
||||
}
|
||||
else
|
||||
refreshRate[0] = 0;
|
||||
@@ -157,7 +157,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
|
||||
if (result->serial)
|
||||
{
|
||||
const uint8_t* nums = (uint8_t*) &result->serial;
|
||||
snprintf(buf, sizeof(buf), "%2X-%2X-%2X-%2X", nums[0], nums[1], nums[2], nums[3]);
|
||||
snprintf(buf, ARRAY_SIZE(buf), "%2X-%2X-%2X-%2X", nums[0], nums[1], nums[2], nums[3]);
|
||||
}
|
||||
else
|
||||
buf[0] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user