temperature: Improve types
authorAaron Marcher <me@drkhsh.at>
Fri, 6 Jul 2018 21:41:02 +0000 (23:41 +0200)
committerAaron Marcher <me@drkhsh.at>
Fri, 6 Jul 2018 21:41:02 +0000 (23:41 +0200)
components/temperature.c

index fe2e0c9903b1303da9b6e69023ac0848b816053a..2c57853d0b35afa3b98853575351f53e8c6a060b 100644 (file)
@@ -4,16 +4,18 @@
 #include "../util.h"
 
 #if defined(__linux__)
+       #include <inttypes.h>
+
        const char *
        temp(const char *file)
        {
-               int temp;
+               uint64_t temp;
 
-               if(pscanf(file, "%d", &temp) != 1) {
+               if(pscanf(file, "%" PRIu64, &temp) != 1) {
                        return NULL;
                }
 
-               return bprintf("%d", temp / 1000);
+               return bprintf("%" PRIu64, temp / 1000);
        }
 #elif defined(__OpenBSD__)
        #include <stdio.h>