diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-05-22 10:07:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-05-22 10:07:10 -0400 |
commit | 832427bdbad9c2e7ad9635ddc1cad05563d9d16a (patch) | |
tree | 0eed70223aed40c0e8459daa70e27d7394fac7ea /btrfsctl.c | |
parent | 723eafc64706679e8932b6cd2fb66005be4f7387 (diff) |
cleanup warnings found with -O2
Diffstat (limited to 'btrfsctl.c')
-rw-r--r-- | btrfsctl.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -33,11 +33,11 @@ int main(int ac, char **av) int fd; int ret; struct btrfs_ioctl_vol_args args; - char *name; + char *name = NULL; int i; struct stat st; DIR *dirstream; - unsigned long command; + unsigned long command = 0; for (i = 1; i < ac - 1; i++) { if (strcmp(av[i], "-s") == 0) { @@ -65,6 +65,10 @@ int main(int ac, char **av) command = BTRFS_IOC_ADD_DISK; } } + if (command == 0) { + fprintf(stderr, "no valid commands given\n"); + exit(1); + } fname = av[ac - 1]; printf("fname is %s\n", fname); ret = stat(fname, &st); |