Introduction
Introduction Statistics Contact Development Disclaimer Help
Fix temperature reporting on OpenBSD - slstatus - status monitor
git clone git://git.suckless.org/slstatus
Log
Files
Refs
README
LICENSE
---
commit 3fc2872d1b3e62903a4af49326d42c97c11911d5
parent 3ac985eb0338773cfb1d1446fc0751f1f2afea94
Author: dsp <[email protected]>
Date: Thu, 31 Oct 2019 22:50:32 -0600
Fix temperature reporting on OpenBSD
On OpenBSD although the formula is correct due to integer division a
temperature of for example 54 celsius appears as 5. this patch first
treats it as a floating point op before retaining the non decimal digits
Diffstat:
M components/temperature.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/components/temperature.c b/components/temperature.c
@@ -45,7 +45,7 @@
}
/* kelvin to celsius */
- return bprintf("%d", (temp.value - 273150000) / 1E6);
+ return bprintf("%d", (int)((float)(temp.value-273150000) / 1E6…
}
#elif defined(__FreeBSD__)
#include <stdio.h>
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.