btrfs-map-logical: segfaults when no output file is given

when no output file is given, info_file stays NULL and the following
fprintf segfaults. Default to stdout.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
master
Arne Jansen 2011-03-14 12:57:49 +01:00 committed by Chris Mason
parent 925ac32518
commit 48d29930ed
1 changed files with 1 additions and 0 deletions

View File

@ -173,6 +173,7 @@ int main(int ac, char **av)
exit(1);
}
info_file = stdout;
if (output_file) {
if (strcmp(output_file, "-") == 0) {
out_fd = 1;