Check the `sectors' vector length before use it
PATCH 1/1 Check the `sectors' vector length before use it
Hi all,
I noticed that the "btrfs-debug-tree -e DEVICE" command returns an empty list. If it is a normal behaviour then this trivial patch solves a problem in the show-blocks program, where the `sectors' vector is used even in the case its length is zero.
Regards,
Giuseppe
Quoted 1 line
From
7caf73f4a7be8baa1493578c56477d3b279773ecMon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <[email protected]>
Date: Sun, 26 Jul 2009 23:12:38 +0200
Subject: [PATCH] Check the vector length before use it
--- show-blocks | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
show-blocks +1 -1
@@ -228,7 +228,7 @@ shapeit(data) sectors = data[:,0] sizes = data[:,1] datalen = len(data) -sectormax = numpy.max(sectors) +sectormax = numpy.max(sectors) if len(sectors) > 0 else 0 sectormin = 0 num_cells = 800 total_cells = num_cells * num_cells
Signature · 1 line
1.6.3.3