slstatus

My fork of https://tools.suckless.org/slstatus/
git clone https://git.inz.fi/slstatus
Log | Files | Refs | README | LICENSE

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:
Mcomponents/temperature.c | 7+++++--
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>