From a425f4405b00d77e5283b2651672334a36f74d47 Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Mon, 19 Feb 2024 18:00:32 +0200 Subject: [PATCH] Fix compiler warning We didn't calculate the right array size and should use the argument we got for it. --- lib/diskscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diskscan.c b/lib/diskscan.c index 369416c..541c5d0 100644 --- a/lib/diskscan.c +++ b/lib/diskscan.c @@ -162,7 +162,7 @@ static void ata_test_temp(disk_t *disk, ata_smart_attr_t *smart, int smart_num) while (temp >= TEMP_THRESHOLD) { sleep(1); spinner_update(&spinner); - smart_num = disk_smart_attributes(&disk->dev, smart, ARRAY_SIZE(smart)); + smart_num = disk_smart_attributes(&disk->dev, smart, smart_num); if (smart_num > 0) { temp = ata_smart_get_temperature(smart, smart_num, disk->state.ata.smart_table, &min_temp, &max_temp); } else {