summaryrefslogtreecommitdiffstats
path: root/tools/h5ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5ls.c')
-rw-r--r--tools/h5ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/h5ls.c b/tools/h5ls.c
index 6dc1ed5..b686f7d 100644
--- a/tools/h5ls.c
+++ b/tools/h5ls.c
@@ -1237,7 +1237,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
(unsigned long)total, 1==total?"":"s");
if (total>0) {
#ifdef WIN32
- hsize_t mask = (hsize_1)1 << (8*sizeof(hsize_t)-1);
+ hsize_t mask = (hsize_t)1 << (8*sizeof(hsize_t)-1);
if ((used & mask) || (total & mask)) {
total = 0; /*prevent utilization printing*/
} else {
@@ -1246,7 +1246,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
#else
utilization = (used*100.0)/total;
#endif
- printf(", %1.2f%% utilization", (used*100.0)/total);
+ if (total) printf(", %1.2f%% utilization", utilization);
}
putchar('\n');