diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-05-30 15:32:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-05-30 15:32:45 +0000 |
commit | ca08ce28e853af0e8e555239cba1a971b58a313f (patch) | |
tree | 26e6fdd96e50f9a969b2ae061da483a4c7d0b996 /src/bin/psql/psql.c | |
parent | 3257b0e592028b90325a23447070d96579b3d67e (diff) | |
download | postgresql-ca08ce28e853af0e8e555239cba1a971b58a313f.tar.gz postgresql-ca08ce28e853af0e8e555239cba1a971b58a313f.zip |
Clean up uninitialized-variable warning from egcs.
(Curious that gcc doesn't complain about this code...).
Diffstat (limited to 'src/bin/psql/psql.c')
-rw-r--r-- | src/bin/psql/psql.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 99b1108918d..f84e96ae126 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.180 1999/05/26 20:08:06 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.181 1999/05/30 15:32:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3118,7 +3118,7 @@ handleCopyIn(PGconn *conn, const bool mustprompt, FILE *copystream) char copybuf[COPYBUFSIZ]; char *s; int buflen; - int c; + int c = 0; if (mustprompt) { @@ -3138,18 +3138,23 @@ handleCopyIn(PGconn *conn, const bool mustprompt, FILE *copystream) while (!linedone) { /* for each buffer ... */ s = copybuf; - buflen = COPYBUFSIZ; - for (; buflen > 1 && - !(linedone = (c = getc(copystream)) == '\n' || c == EOF); - --buflen) + for (buflen = COPYBUFSIZ; buflen > 1; buflen--) + { + c = getc(copystream); + if (c == '\n' || c == EOF) + { + linedone = true; + break; + } *s++ = c; + } + *s = '\0'; if (c == EOF) { PQputline(conn, "\\."); copydone = true; break; } - *s = '\0'; PQputline(conn, copybuf); if (firstload) { |