Avoid a coverity warning
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-03-15 15:44:13 +01:00
parent df29e95cef
commit fa13703a7f

View file

@ -2359,7 +2359,7 @@ int ambient_temperature(void)
char label[128];
char* dash;
char* e;
int temp;
long temp;
if (strncmp(hwmon_entry->d_name, "temp", 4) != 0)
continue;
@ -2398,7 +2398,7 @@ int ambient_temperature(void)
pathcpy(label, sizeof(label), hwmon_entry->d_name);
}
log_tag("thermal:ambient:device:%s:%s:%s:%s:%d\n", entry->d_name, name, hwmon_entry->d_name, label, temp);
log_tag("thermal:ambient:device:%s:%s:%s:%s:%ld\n", entry->d_name, name, hwmon_entry->d_name, label, temp);
/* check if temperature is in reasonable range */
if (temp < 15 || temp > 40)
@ -2410,7 +2410,7 @@ int ambient_temperature(void)
/* check if label matches possible ambient labels */
for (int i = 0; AMBIENT_LABEL[i]; ++i) {
if (worddigitstr(label, AMBIENT_LABEL[i]) != 0) {
log_tag("thermal:ambient:candidate:%d\n", temp);
log_tag("thermal:ambient:candidate:%ld\n", temp);
if (lowest_temp == 0 || lowest_temp > temp)
lowest_temp = temp;
break;
@ -2419,7 +2419,7 @@ int ambient_temperature(void)
/* accept also generic "temp1" */
if (strcmp(label, "temp1") == 0) {
log_tag("thermal:ambient:candidate:%d\n", temp);
log_tag("thermal:ambient:candidate:%ld\n", temp);
if (lowest_temp == 0 || lowest_temp > temp)
lowest_temp = temp;
}