From e12694523e7e4482a052236f12d3d8b58be9a22c Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Mon, 9 Aug 2021 08:26:59 -0700 Subject: [PATCH] Fix bogus assertion in BootstrapModeMain(). The assertion was always true, as written, thanks to me "simplifying" it before commit. Per coverity and Tom Lane. --- src/backend/bootstrap/bootstrap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 3416802811b..48615c0ebcb 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -215,9 +215,9 @@ BootstrapModeMain(int argc, char *argv[], bool check_only) InitializeGUCOptions(); /* an initial --boot or --check should be present */ - Assert(argc == 1 - || strcmp(argv[1], "--boot") != 0 - || strcmp(argv[1], "--check") != 0); + Assert(argc > 1 + && (strcmp(argv[1], "--boot") == 0 + || strcmp(argv[1], "--check") == 0)); argv++; argc--;