summaryrefslogtreecommitdiff
path: root/btrfs-vol.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-05-01 10:22:47 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-05-01 10:22:47 -0400
commitf86e8be3f89fe64020aa0bc0d07590aa2ed65250 (patch)
tree8f97d1373c8fd9ffbd39474f5ae38f310a1b782a /btrfs-vol.c
parent9a34051c5183ef91674420f4326da2390d7e4be6 (diff)
Fix uninitialized variables, and use -O so gcc starts checking for them
Gcc only sends warnings for uninitialized variables when you compile with -O, and there were a couple of bugs sprinkled in the code. The biggest was the alloc_start variable for mkfs, which can cause strange things to happen. (thanks to Gabor Micsko for helping to find this)
Diffstat (limited to 'btrfs-vol.c')
-rw-r--r--btrfs-vol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/btrfs-vol.c b/btrfs-vol.c
index 0cc2e979..9eddd782 100644
--- a/btrfs-vol.c
+++ b/btrfs-vol.c
@@ -71,9 +71,9 @@ int main(int ac, char **av)
char *mnt = NULL;
int ret;
int option_index = 0;
- int cmd;
+ int cmd = 0;
int fd;
- int devfd;
+ int devfd = 0;
DIR *dirstream;
struct btrfs_ioctl_vol_args args;
u64 dev_block_count = 0;