Parcourir la source

Fix disk_perc by casting it to int

Aaron Marcher il y a 7 ans
Parent
commit
dcffaeaf57
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      components/disk.c

+ 2 - 2
components/disk.c

@@ -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 *