update src/bin/pg_basebackup/pg_basebackup.cpp.
在生成tar压缩文件时,文件大小记录在文件头部信息中的1048~1080字节,解压时确读取了201个字节,初步判断为读取20个字节,并且保存到一个长整型中,源码内误把小写l写成数字1
This commit is contained in:
@ -906,7 +906,7 @@ static void ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
|
||||
}
|
||||
totaldone += TAR_BLOCK_SIZE;
|
||||
|
||||
if (sscanf_s(copybuf + TAR_LEN_LEFT, "%201o", ¤t_len_left) != 1) {
|
||||
if (sscanf_s(copybuf + TAR_LEN_LEFT, "%20lo", ¤t_len_left) != 1) {
|
||||
pg_log(stderr, _("%s: could not parse file size\n"), progname);
|
||||
disconnect_and_exit(1);
|
||||
}
|
||||
@ -1670,7 +1670,7 @@ static int GsTar(int argc, char** argv)
|
||||
}
|
||||
totaldone += TAR_BLOCK_SIZE;
|
||||
|
||||
if (sscanf_s(copybuf + 1048, "%201o", ¤t_len_left) != 1) {
|
||||
if (sscanf_s(copybuf + 1048, "%20lo", ¤t_len_left) != 1) {
|
||||
fprintf(stderr, "%s: could not parse file size\n", progname);
|
||||
GS_FREE(copybuf);
|
||||
CLOSE_AND_RETURN(tarfile);
|
||||
|
Reference in New Issue
Block a user