aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-crc.c
diff options
context:
space:
mode:
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>2016-06-02 17:14:57 +0900
committerDavid Sterba <dsterba@suse.com>2016-06-03 14:49:43 +0200
commit97198cd75e15457360aba93a28af65458292694f (patch)
tree849ae09d4bd5f581dbdfa39852d35146e5f452cf /btrfs-crc.c
parentff6fe039d366ee5dee056c333a28a98e35598197 (diff)
downloadbtrfs-progs-97198cd75e15457360aba93a28af65458292694f.tar.gz
btrfs-progs-97198cd75e15457360aba93a28af65458292694f.tar.xz
btrfs-progs-97198cd75e15457360aba93a28af65458292694f.zip
btrfs-progs: btrfs-crc: make argc check more strict
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-crc.c')
-rw-r--r--btrfs-crc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/btrfs-crc.c b/btrfs-crc.c
index 27244d7..c3e4774 100644
--- a/btrfs-crc.c
+++ b/btrfs-crc.c
@@ -69,12 +69,14 @@ int main(int argc, char **argv)
str = argv[optind];
if (!loop) {
- if (check_argc_min(argc - optind, 1))
+ if (check_argc_exact(argc - optind, 1))
print_usage(255);
printf("%12u - %s\n", crc32c(~1, str, strlen(str)), str);
return 0;
}
+ if (check_argc_exact(argc - optind, 0))
+ print_usage(255);
buf = malloc(length);
if (!buf)