all repos — slstatus @ 7873b3b1329d31e619a93cce99350a36803656d1

my build of slstatus (tools.suckless.org/slstatus/)

Make temp more readable on Linux
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 00:30:16 +0200
commit

7873b3b1329d31e619a93cce99350a36803656d1

parent

951ea4e304cf23f8464a4b6896cfcf4035920249

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M components/temperature.ccomponents/temperature.c

@@ -9,8 +9,11 @@ temp(const char *file)

{ 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>