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.
This commit is contained in:
Robert Haas 2012-09-06 15:43:46 -04:00
parent 987277f402
commit 83f2584f15

View File

@ -2573,7 +2573,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);