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

Commit1dad866

Browse files
committed
Someone report me small bug in contrib/pg_dumplo today. It's problem
with a little dirty snprintf() usage which I used some years ago: snprintf(path, BUFSIZ, "%s/lo_dump.index", path);Karel Zak
1 parent6687152 commit1dad866

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎contrib/pg_dumplo/utils.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -------------------------------------------------------------------------
22
* pg_dumplo
33
*
4-
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/utils.c,v 1.6 2002/09/05 21:01:16 tgl Exp $
4+
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/utils.c,v 1.7 2003/10/09 13:38:05 momjian Exp $
55
*
66
*Karel Zak 1999-2000
77
* -------------------------------------------------------------------------
@@ -30,6 +30,7 @@ void
3030
index_file(LODumpMaster*pgLO)
3131
{
3232
charpath[BUFSIZ];
33+
intsz;
3334

3435
if (pgLO->action==ACTION_SHOW)
3536
return;
@@ -49,7 +50,8 @@ index_file(LODumpMaster * pgLO)
4950
}
5051
}
5152

52-
snprintf(path,BUFSIZ,"%s/lo_dump.index",path);
53+
sz=strlen(path);
54+
strncat(path,"/lo_dump.index",BUFSIZ-sz);
5355

5456
if ((pgLO->index=fopen(path,"w"))==NULL)
5557
{
@@ -60,8 +62,8 @@ index_file(LODumpMaster * pgLO)
6062
}
6163
elseif (pgLO->action!=ACTION_NONE)
6264
{
63-
64-
snprintf(path,BUFSIZ,"%s/lo_dump.index",path);
65+
sz=strlen(path);
66+
strncat(path,"/lo_dump.index",BUFSIZ-sz);
6567

6668
if ((pgLO->index=fopen(path,"r"))==NULL)
6769
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp