aboutsummaryrefslogtreecommitdiff
path: root/cmd/bolt/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/bolt/main.go')
-rw-r--r--cmd/bolt/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go
index ebf21d5..1f78e03 100644
--- a/cmd/bolt/main.go
+++ b/cmd/bolt/main.go
@@ -828,7 +828,10 @@ func (cmd *StatsCommand) Run(args ...string) error {
fmt.Fprintln(cmd.Stdout, "Bucket statistics")
fmt.Fprintf(cmd.Stdout, "\tTotal number of buckets: %d\n", s.BucketN)
- percentage = int(float32(s.InlineBucketN) * 100.0 / float32(s.BucketN))
+ percentage = 0
+ if s.BucketN != 0 {
+ percentage = int(float32(s.InlineBucketN) * 100.0 / float32(s.BucketN))
+ }
fmt.Fprintf(cmd.Stdout, "\tTotal number on inlined buckets: %d (%d%%)\n", s.InlineBucketN, percentage)
percentage = 0
if s.LeafInuse != 0 {