btrfs-progs: don't overrun "answer" array in cmds-chunk.c
authorZach Brown <zab@redhat.com>
Tue, 6 Aug 2013 18:49:04 +0000 (11:49 -0700)
committerDavid Sterba <dsterba@suse.cz>
Tue, 3 Sep 2013 17:40:52 +0000 (19:40 +0200)
commit6a0af4e57b58e9756e246db6967423ea6fa83265
tree1eb84334ca9622d73ede5c72aaf01b012cea1dcc
parent689ad3e362c1e6d54ef7b6876dbb64e1e51b8cf1
btrfs-progs: don't overrun "answer" array in cmds-chunk.c

Eric noticed the trivial stack overflow bug in ask_user().  I went to
see the context for that fix and found that ask_user() was a bit much.

This fixes the overflow bug that Eric found, endless spinning on scanf()
errors, removes dead code, and leaves us with a trivial helper.

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>
cmds-chunk.c