summaryrefslogtreecommitdiff
path: root/btrfs-show-super.c
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-08-14 16:16:35 -0700
committerDavid Sterba <dsterba@suse.cz>2013-09-03 19:41:03 +0200
commitfd074864c4cc319f1969b9b3513cef654a6648ea (patch)
tree5bfce93cc02d87c9427efa9473b0d4180ea11f23 /btrfs-show-super.c
parent19a2e1f4611eeff9668dacecafb6e51b5ca0f704 (diff)
downloadbtrfs-progs-fd074864c4cc319f1969b9b3513cef654a6648ea.tar.gz
btrfs-progs: remove variable length stack arrays
sparse hates variable length array definitions on the stack: btrfs-show-super.c:155:21: warning: Variable length array is used. And it's right to. They're a fragile construct that doesn't handle bad input well at all. Signed-off-by: Zach Brown <zab@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'btrfs-show-super.c')
-rw-r--r--btrfs-show-super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/btrfs-show-super.c b/btrfs-show-super.c
index c2e844d..0c3c73c 100644
--- a/btrfs-show-super.c
+++ b/btrfs-show-super.c
@@ -152,7 +152,7 @@ static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr)
static int check_csum_sblock(void *sb, int csum_size)
{
- char result[csum_size];
+ char result[BTRFS_CSUM_SIZE];
u32 crc = ~(u32)0;
crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE,