Skip to content

Commit 45bec2e

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6983f4e commit 45bec2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/helper/test-parse-options.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ int cmd__parse_options_flags(int argc, const char **argv)
255255
argc = parse_options(argc, argv, NULL, test_flag_options, usage,
256256
PARSE_OPT_STOP_AT_NON_OPTION);
257257

258-
if (argc == 0 || strcmp(argv[0], "cmd")) {
258+
if (!argc || strcmp(argv[0], "cmd")) {
259259
error("'cmd' is mandatory");
260260
usage_with_options(usage, test_flag_options);
261261
}
@@ -313,7 +313,7 @@ int cmd__parse_subcommand(int argc, const char **argv)
313313
argc = parse_options(argc, argv, NULL, test_flag_options, usage,
314314
PARSE_OPT_STOP_AT_NON_OPTION);
315315

316-
if (argc == 0 || strcmp(argv[0], "cmd")) {
316+
if (!argc || strcmp(argv[0], "cmd")) {
317317
error("'cmd' is mandatory");
318318
usage_with_options(usage, test_flag_options);
319319
}

0 commit comments

Comments
 (0)