diff options
author | sinanmohd <sinan@sinanmohd.com> | 2023-12-31 00:39:25 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2023-12-31 00:47:01 +0530 |
commit | d777a9e6e23ccdef0fb5d29c39a9fd19e3d24804 (patch) | |
tree | ed1a9fa50a5d9af883d8c0fcc026999031c74a91 | |
parent | 84f1e50cb1a959f3a835b8ba265159cc6e75635a (diff) |
pass.c: check argc instead of argv
-rw-r--r-- | pass.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -103,22 +103,22 @@ int main(int argc, char *argv[]) if (!strcmp("help", *argv)) { print_usage(); } else if (!strcmp("init", *argv)) { - if (!argv[1]) + if (argc != 2) err_die(1, "invalid usage, try pass help"); r = pass_init(argv[1]); } else if (!strcmp("cat", *argv)) { - if (!argv[1]) + if (argc != 2) err_die(1, "invalid usage, try pass help"); r = cat(argv[1]); } else if (!strcmp("add", *argv)) { - if (!argv[1]) + if (argc != 2) err_die(1, "invalid usage, try pass help"); r = add(argv[1]); } else if (!strcmp("rm", *argv)) { - if (!argv[1]) + if (argc != 2) err_die(1, "invalid usage, try pass help"); r = pass_rm(argv[1]); |