From: Robert Haas Date: Thu, 6 Sep 2012 19:43:46 +0000 (-0400) Subject: Fix "too many arguments" messages not to index off the end of argv[]. X-Git-Tag: REL9_1_6~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e40b20a3686d2f8f2d8b5f1d82a6b36717d4ab1d;p=thirdparty%2Fpostgresql.git 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. --- diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 018cfdc1506..ab498185154 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -2654,7 +2654,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);