1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

The result of getopt() should be compared to -1, not EOF, per

pgsql-hackers discussion of this date.
This commit is contained in:
Tom Lane
2002-01-10 01:11:45 +00:00
parent 4d72af6cb3
commit 92a2598f97
8 changed files with 20 additions and 19 deletions

View File

@ -16,6 +16,9 @@
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include "libpq-fe.h"
#include "dbf.h"
@ -673,7 +676,7 @@ main(int argc, char **argv)
char *query;
dbhead *dbh;
while ((i = getopt(argc, argv, "DWflucvh:b:e:d:t:s:B:U:F:T:")) != EOF)
while ((i = getopt(argc, argv, "DWflucvh:b:e:d:t:s:B:U:F:T:")) != -1)
{
switch (i)
{

View File

@ -67,7 +67,7 @@ get_opts(int argc, char **argv, struct options * my_opts)
my_opts->remotepass = 0;
/* get opts */
while ((c = getopt(argc, argv, "H:p:U:P:d:t:o:xh?")) != EOF)
while ((c = getopt(argc, argv, "H:p:U:P:d:t:o:xh?")) != -1)
{
switch (c)
{

View File

@ -1,5 +1,5 @@
/*
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.13 2001/11/05 17:46:23 momjian Exp $
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.14 2002/01/10 01:11:45 tgl Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
@ -641,7 +641,7 @@ main(int argc, char **argv)
PGconn *con;
PGresult *res;
while ((c = getopt(argc, argv, "ih:nvp:dc:t:s:U:P:CS")) != EOF)
while ((c = getopt(argc, argv, "ih:nvp:dc:t:s:U:P:CS")) != -1)
{
switch (c)
{