summaryrefslogtreecommitdiff
path: root/components/temperature.c
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2018-05-20 00:30:16 +0200
committerAaron Marcher <me@drkhsh.at>2018-05-20 00:30:16 +0200
commit7873b3b1329d31e619a93cce99350a36803656d1 (patch)
tree27b6856a7cd0fae755828fa2a910d9bdef13ca68 /components/temperature.c
parent951ea4e304cf23f8464a4b6896cfcf4035920249 (diff)
Make temp more readable on Linux
Diffstat (limited to 'components/temperature.c')
-rw-r--r--components/temperature.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/temperature.c b/components/temperature.c
index 32eb691..7e5cbe7 100644
--- a/components/temperature.c
+++ b/components/temperature.c
@@ -9,8 +9,11 @@
{
int temp;
- return (pscanf(file, "%d", &temp) == 1) ?
- bprintf("%d°C", temp / 1000) : NULL;
+ if(pscanf(file, "%d", &temp) != 1) {
+ return NULL;
+ }
+
+ return bprintf("%d°C", temp / 1000);
}
#elif defined(__OpenBSD__)
#include <errno.h>