Fixes missing Fahrenheit conversion with raw output enabled

This commit is contained in:
Samuel FORESTIER committed 2019-10-07 19:30:11 +02:00
1 parent 10c4f2afdf
commit ab69812631
1 file changed
+9 -6
+9 -6
View File
@@ -34,6 +34,11 @@
static void scale_value(double *value, const char **prefixstr);
static inline double deg_ctof(double cel)
{
return cel * (9.0F / 5.0F) + 32.0F;
}
void print_chip_raw(const sensors_chip_name *name)
{
int a, b, err;
@@ -60,8 +65,11 @@ void print_chip_raw(const sensors_chip_name *name)
"value of subfeature %s: %s\n",
sub->name,
sensors_strerror(err));
else
else {
if (fahrenheit)
val = deg_ctof(val);
printf(" %s: %.3f\n", sub->name, val);
}
} else
printf("(%s)\n", label);
}
@@ -69,11 +77,6 @@ void print_chip_raw(const sensors_chip_name *name)
}
}
static inline double deg_ctof(double cel)
{
return cel * (9.0F / 5.0F) + 32.0F;
}
void print_chip_json(const sensors_chip_name *name)
{
int a, b, cnt, subCnt, err;