Xinqi Bao's Git

ram: fixed int overflow on pagetok macro
[slstatus.git] / components / temperature.c
index 64199f5..4e27a9d 100644 (file)
@@ -9,8 +9,11 @@
        {
                int temp;
 
-               return (pscanf(file, "%d", &temp) == 1) ?
-                      bprintf("%d", temp / 1000) : NULL;
+               if(pscanf(file, "%d", &temp) != 1) {
+                       return NULL;
+               }
+
+               return bprintf("%d", temp / 1000);
        }
 #elif defined(__OpenBSD__)
        #include <errno.h>