mbpfan-josie

Prefer simpler strtod over sscanf

2ed1671aa7ef9c0dfff6bea78fc155410215348f
Andrew Gaul <andrew@gaul.org> · 2019-10-28T23:21 · browse files at this commit

parents: 2c743b0

diff --git a/src/mbpfan.c b/src/mbpfan.c
index fad6ac9..2e02fd6 100644
--- a/src/mbpfan.c
+++ b/src/mbpfan.c
@@ -417,7 +417,7 @@ t_sensors *refresh_sensors(t_sensors *sensors)
             char buf[16];
             int len = pread(fileno(tmp->file), buf, sizeof(buf), /*offset=*/ 0);
             buf[len] = '\0';
-            sscanf(buf, "%d", &tmp->temperature);
+            tmp->temperature = strtod(buf, NULL);
         }
 
         tmp = tmp->next;