Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca08ce2

Browse files
committed
Clean up uninitialized-variable warning from egcs.
(Curious that gcc doesn't complain about this code...).
1 parent3257b0e commitca08ce2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎src/bin/psql/psql.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.180 1999/05/26 20:08:06 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.181 1999/05/30 15:32:45 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -3118,7 +3118,7 @@ handleCopyIn(PGconn *conn, const bool mustprompt, FILE *copystream)
31183118
charcopybuf[COPYBUFSIZ];
31193119
char*s;
31203120
intbuflen;
3121-
intc;
3121+
intc=0;
31223122

31233123
if (mustprompt)
31243124
{
@@ -3138,18 +3138,23 @@ handleCopyIn(PGconn *conn, const bool mustprompt, FILE *copystream)
31383138
while (!linedone)
31393139
{/* for each buffer ... */
31403140
s=copybuf;
3141-
buflen=COPYBUFSIZ;
3142-
for (;buflen>1&&
3143-
!(linedone= (c=getc(copystream))=='\n'||c==EOF);
3144-
--buflen)
3141+
for (buflen=COPYBUFSIZ;buflen>1;buflen--)
3142+
{
3143+
c=getc(copystream);
3144+
if (c=='\n'||c==EOF)
3145+
{
3146+
linedone= true;
3147+
break;
3148+
}
31453149
*s++=c;
3150+
}
3151+
*s='\0';
31463152
if (c==EOF)
31473153
{
31483154
PQputline(conn,"\\.");
31493155
copydone= true;
31503156
break;
31513157
}
3152-
*s='\0';
31533158
PQputline(conn,copybuf);
31543159
if (firstload)
31553160
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp