16
16
*
17
17
*
18
18
* 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 $
20
20
*
21
21
*-------------------------------------------------------------------------
22
22
*/
@@ -1147,6 +1147,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
1147
1147
int sum ,
1148
1148
chk ;
1149
1149
size_t len ;
1150
+ unsigned long ullen ;
1150
1151
off_t hPos ;
1151
1152
int i ;
1152
1153
bool gotBlock = false;
@@ -1203,16 +1204,17 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
1203
1204
}
1204
1205
}
1205
1206
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 ;
1208
1210
sscanf (& h [148 ], "%8o" , & sum );
1209
1211
1210
1212
{
1211
1213
char buf [100 ];
1212
1214
1213
1215
snprintf (buf , 100 , INT64_FORMAT , (int64 ) hPos );
1214
1216
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 );
1216
1218
}
1217
1219
1218
1220
if (chk != sum )
@@ -1223,7 +1225,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
1223
1225
die_horribly (AH , modulename ,
1224
1226
"corrupt tar header found in %s "
1225
1227
"(expected %d, computed %d) file position %s\n" ,
1226
- & tag [ 0 ] , sum , chk , buf );
1228
+ tag , sum , chk , buf );
1227
1229
}
1228
1230
1229
1231
th -> targetFile = strdup (tag );
0 commit comments