mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
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>
This commit is contained in:
parent
ff6fe039d3
commit
97198cd75e
@ -69,12 +69,14 @@ int main(int argc, char **argv)
|
|||||||
str = argv[optind];
|
str = argv[optind];
|
||||||
|
|
||||||
if (!loop) {
|
if (!loop) {
|
||||||
if (check_argc_min(argc - optind, 1))
|
if (check_argc_exact(argc - optind, 1))
|
||||||
print_usage(255);
|
print_usage(255);
|
||||||
|
|
||||||
printf("%12u - %s\n", crc32c(~1, str, strlen(str)), str);
|
printf("%12u - %s\n", crc32c(~1, str, strlen(str)), str);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (check_argc_exact(argc - optind, 0))
|
||||||
|
print_usage(255);
|
||||||
|
|
||||||
buf = malloc(length);
|
buf = malloc(length);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
|
Loading…
Reference in New Issue
Block a user