change syscap_tool parameters judegement.

Signed-off-by: yudechen <chenyude@huawei.com>
Change-Id: I12ddfb81501508bb35b1a76e7d2e0fb2a22aca87
This commit is contained in:
yudechen
2022-06-13 10:18:41 +08:00
parent e6e07b098b
commit 30fea55f9b
+2 -2
View File
@@ -80,8 +80,8 @@ int main(int argc, char **argv)
break;
case 'C':
pcidfile = optarg;
if (optind < 0 || optind > argc) {
PRINT_ERR("Input file path too few or too many.\n");
if (argc != 4 || optind < 0 || optind >= argc) { // 4, argc of ./syscap_tool -C f1 f2
PRINT_ERR("Input file too few or too many.\n");
return -1;
}
rpcidfile = argv[optind];