diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2022-09-05 21:50:05 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-07 22:06:12 +0300 |
commit | 45bec2ead294b5f3565903995d3503ba31b8ad4a (patch) | |
tree | c2ea4c3f46cfba77f4995ca1f29872fd6d823def /t/helper | |
parent | 6983f4e3b205a48cfcb76e14a8b275f9eb72936d (diff) |
test-parse-options.c: fix style of comparison with zero
The preferred style is '!argc' instead of 'argc == 0'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r-- | t/helper/test-parse-options.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c index 9fe8ce66cb..506835521a 100644 --- a/t/helper/test-parse-options.c +++ b/t/helper/test-parse-options.c @@ -255,7 +255,7 @@ int cmd__parse_options_flags(int argc, const char **argv) argc = parse_options(argc, argv, NULL, test_flag_options, usage, PARSE_OPT_STOP_AT_NON_OPTION); - if (argc == 0 || strcmp(argv[0], "cmd")) { + if (!argc || strcmp(argv[0], "cmd")) { error("'cmd' is mandatory"); usage_with_options(usage, test_flag_options); } @@ -313,7 +313,7 @@ int cmd__parse_subcommand(int argc, const char **argv) argc = parse_options(argc, argv, NULL, test_flag_options, usage, PARSE_OPT_STOP_AT_NON_OPTION); - if (argc == 0 || strcmp(argv[0], "cmd")) { + if (!argc || strcmp(argv[0], "cmd")) { error("'cmd' is mandatory"); usage_with_options(usage, test_flag_options); } |