diff --git a/src/bin/pg_basebackup/pg_basebackup.cpp b/src/bin/pg_basebackup/pg_basebackup.cpp index 164b7c10b..2322b6e77 100644 --- a/src/bin/pg_basebackup/pg_basebackup.cpp +++ b/src/bin/pg_basebackup/pg_basebackup.cpp @@ -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);