aboutsummaryrefslogtreecommitdiff
path: root/hardinfo
diff options
context:
space:
mode:
authortheHacker <git@thehacker.biz>2016-06-10 10:02:36 +0200
committertheHacker <git@thehacker.biz>2016-06-10 10:02:36 +0200
commit2bcf48232e50a6c816127a612dfe2390b046aacc (patch)
tree1754fbdfa04e86d766a79262cc471896e94aa197 /hardinfo
parent76ec9b8bd9c868eba06e5eea5b908982f3426fa3 (diff)
util.c: introduced TiB and PiB for larger drives
Diffstat (limited to 'hardinfo')
-rw-r--r--hardinfo/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hardinfo/util.c b/hardinfo/util.c
index e9b2f930..2795bd78 100644
--- a/hardinfo/util.c
+++ b/hardinfo/util.c
@@ -44,6 +44,8 @@
#define KiB 1024
#define MiB 1048576
#define GiB 1073741824
+#define TiB 1099511627776
+#define PiB 1125899906842624
static GSList *modules_list = NULL;
@@ -118,8 +120,12 @@ inline gchar *size_human_readable(gfloat size)
return g_strdup_printf(_("%.1f KiB"), size / KiB);
if (size < GiB)
return g_strdup_printf(_("%.1f MiB"), size / MiB);
+ if (size < TiB)
+ return g_strdup_printf(_("%.1f GiB"), size / GiB);
+ if (size < PiB)
+ return g_strdup_printf(_("%.1f TiB"), size / TiB);
- return g_strdup_printf(_("%.1f GiB"), size / GiB);
+ return g_strdup_printf(_("%.1f PiB"), size / PiB);
}
inline char *strend(gchar * str, gchar chr)