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

Commit87e76d0

Browse files
committed
Fix portability problem (size_t != int).
1 parent94d8a79 commit87e76d0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

‎src/bin/pg_dump/pg_backup_files.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
*
2222
* IDENTIFICATION
23-
*$Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.18 2002/09/04 20:31:34 momjian Exp $
23+
*$Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.19 2002/09/10 18:25:13 tgl Exp $
2424
*
2525
*-------------------------------------------------------------------------
2626
*/
@@ -413,7 +413,7 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
413413

414414
res=fwrite(buf,1,len,AH->FH);
415415
if (res!=len)
416-
die_horribly(AH,modulename,"write error in _WriteBuf (%d != %d)\n",res,len);
416+
die_horribly(AH,modulename,"write error in _WriteBuf (%lu != %lu)\n",(unsigned long)res, (unsigned long)len);
417417

418418
ctx->filePos+=res;
419419
returnres;

‎src/bin/pg_dump/pg_backup_tar.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
*$Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.29 2002/09/06 21:58:36 petere Exp $
19+
*$Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.30 2002/09/10 18:22:20 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -1147,6 +1147,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
11471147
intsum,
11481148
chk;
11491149
size_tlen;
1150+
unsigned longullen;
11501151
off_thPos;
11511152
inti;
11521153
boolgotBlock= false;
@@ -1203,16 +1204,17 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
12031204
}
12041205
}
12051206

1206-
sscanf(&h[0],"%99s",&tag[0]);
1207-
sscanf(&h[124],"%12o",&len);
1207+
sscanf(&h[0],"%99s",tag);
1208+
sscanf(&h[124],"%12lo",&ullen);
1209+
len= (size_t)ullen;
12081210
sscanf(&h[148],"%8o",&sum);
12091211

12101212
{
12111213
charbuf[100];
12121214

12131215
snprintf(buf,100,INT64_FORMAT, (int64)hPos);
12141216
ahlog(AH,3,"TOC Entry %s at %s (length %lu, checksum %d)\n",
1215-
&tag[0],buf, (unsigned long)len,sum);
1217+
tag,buf, (unsigned long)len,sum);
12161218
}
12171219

12181220
if (chk!=sum)
@@ -1223,7 +1225,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
12231225
die_horribly(AH,modulename,
12241226
"corrupt tar header found in %s "
12251227
"(expected %d, computed %d) file position %s\n",
1226-
&tag[0],sum,chk,buf);
1228+
tag,sum,chk,buf);
12271229
}
12281230

12291231
th->targetFile=strdup(tag);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp