]> granicus.if.org Git - postgresql/commitdiff
Fix "too many arguments" messages not to index off the end of argv[].
authorRobert Haas <rhaas@postgresql.org>
Thu, 6 Sep 2012 19:43:46 +0000 (15:43 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 6 Sep 2012 19:52:07 +0000 (15:52 -0400)
This affects initdb, clusterdb, reindexdb, and vacuumdb in master
and 9.2; in earlier branches, only initdb is affected.

src/bin/initdb/initdb.c

index 0febcf1fcfb451e630f6ede042cbae27205f8abb..9994d891d1f483611f5aa80e5d9e307fb0945ffe 100644 (file)
@@ -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);