commit 7873b3b1329d31e619a93cce99350a36803656d1
parent 951ea4e304cf23f8464a4b6896cfcf4035920249
Author: Aaron Marcher <me@drkhsh.at>
Date: Sun, 20 May 2018 00:30:16 +0200
Make temp more readable on Linux
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git 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>