Xinqi Bao's Git

Fix disk_perc by casting it to int
authorAaron Marcher <[email protected]>
Mon, 7 May 2018 10:14:46 +0000 (12:14 +0200)
committerAaron Marcher <[email protected]>
Mon, 7 May 2018 10:14:46 +0000 (12:14 +0200)
components/disk.c

index a225421..1251edb 100644 (file)
@@ -30,8 +30,8 @@ disk_perc(const char *mnt)
                return NULL;
        }
 
-       return bprintf("%d", 100 *
-                                  (1.0f - ((float)fs.f_bfree / (float)fs.f_blocks)));
+       return bprintf("%d", (int)(100 *
+                                  (1.0f - ((float)fs.f_bfree / (float)fs.f_blocks))));
 }
 
 const char *