summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgroeck <groeck@7894878c-1315-0410-8ee3-d5d059ff63e0>2011-03-16 14:55:04 +0000
committergroeck <groeck@7894878c-1315-0410-8ee3-d5d059ff63e0>2011-03-16 14:55:04 +0000
commitfac13240b7707e0f789cf9eb686e34b278a9c37b (patch)
treeb4ff9815e6724b5bf947176c40dcddba1b274de3
parent0bb1fba5770018537bdc8ea7b6c9267227fa55cf (diff)
downloadlm-sensors-fac13240b7707e0f789cf9eb686e34b278a9c37b.tar.gz
sensors: If an attribute value is 0, display the value with its base unit,
not with the minumum supported unit. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5942 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r--CHANGES2
-rw-r--r--prog/sensors/chips.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 1387a20d..2305cfb7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -14,6 +14,8 @@ SVN HEAD
Add a section for the W83627UHG
sensors: Display 3 decimal places in raw output
Add support for intrusion detection (#2370)
+ If an attribute value is 0, display the value with its base unit,
+ not with the minumum supported unit
sensors-detect: Improve LM90 and W83L771 detection
Fix error seen if I2C bus numbers are not sequential
Add detection of SMSC EMC1423
diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c
index 3946e0e5..01c65323 100644
--- a/prog/sensors/chips.c
+++ b/prog/sensors/chips.c
@@ -441,6 +441,11 @@ static void scale_value(double *value, const char **prefixstr)
};
struct scale_table *scale = prefix_scales;
+ if (abs_value == 0) {
+ *prefixstr = "";
+ return;
+ }
+
while (scale->upper_bound && abs_value > scale->upper_bound) {
divisor = scale->upper_bound;
scale++;