Xinqi Bao's Git

Fix temperature reporting on OpenBSD
[slstatus.git] / components / temperature.c
index 8462d0f..8e1f222 100644 (file)
@@ -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>