projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
951ea4e
)
Make temp more readable on Linux
author
Aaron Marcher
<me@drkhsh.at>
Sat, 19 May 2018 22:30:16 +0000
(
00:30
+0200)
committer
Aaron Marcher
<me@drkhsh.at>
Sat, 19 May 2018 22:30:16 +0000
(
00:30
+0200)
components/temperature.c
patch
|
blob
|
history
diff --git
a/components/temperature.c
b/components/temperature.c
index 32eb6914407f8f0bfdab821c0042f47c1e153f37..7e5cbe7c063c33fe0237c2da2d023d47d8c1f0e7 100644
(file)
--- 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>