From 7e21ff3edb87ebd0575aa2e0e4fd7743c5a1af88 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 6 Sep 2012 15:43:46 -0400 Subject: [PATCH] Fix "too many arguments" messages not to index off the end of argv[]. This affects initdb, clusterdb, reindexdb, and vacuumdb in master and 9.2; in earlier branches, only initdb is affected. --- src/bin/initdb/initdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 0febcf1fcf..9994d891d1 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -2622,7 +2622,7 @@ main(int argc, char *argv[]) if (optind < argc) { fprintf(stderr, _("%s: too many command-line arguments (first is \"%s\")\n"), - progname, argv[optind + 1]); + progname, argv[optind]); fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname); exit(1); -- 2.50.1