summaryrefslogtreecommitdiff
path: root/btrfs-crc.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfs-crc.c')
-rw-r--r--btrfs-crc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/btrfs-crc.c b/btrfs-crc.c
index 1990534a..723e0b7a 100644
--- a/btrfs-crc.c
+++ b/btrfs-crc.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <unistd.h>
#include "crc32c.h"
+#include "utils.h"
void usage(void)
{
@@ -62,13 +63,13 @@ int main(int argc, char **argv)
}
}
+ set_argv0(argv);
str = argv[optind];
if (!loop) {
- if (optind >= argc) {
- fprintf(stderr, "not enough arguments\n");
+ if (check_argc_min(argc - optind, 1))
return 255;
- }
+
printf("%12u - %s\n", crc32c(~1, str, strlen(str)), str);
return 0;
}