浏览代码

Fix disk_perc by casting it to int

Aaron Marcher 8 年之前
父节点
当前提交
dcffaeaf57
共有 1 个文件被更改,包括 2 次插入2 次删除
  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 *