diff options
author | Zach Brown <zab@redhat.com> | 2013-08-14 16:16:35 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-09-03 19:41:03 +0200 |
commit | fd074864c4cc319f1969b9b3513cef654a6648ea (patch) | |
tree | 5bfce93cc02d87c9427efa9473b0d4180ea11f23 /btrfs-show-super.c | |
parent | 19a2e1f4611eeff9668dacecafb6e51b5ca0f704 (diff) | |
download | btrfs-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.c | 2 |
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, |