Skip to content

Commit d51f704

Browse files
committed
pg_dump: Replace can't-happen error with assertion
1 parent 641b76d commit d51f704

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_dump/pg_backup_tar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh)
515515
size_t used = 0;
516516
size_t res = 0;
517517

518+
Assert(th || fh);
519+
518520
avail = AH->lookaheadLen - AH->lookaheadPos;
519521
if (avail > 0)
520522
{
@@ -567,8 +569,6 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh)
567569
READ_ERROR_EXIT(th->nFH);
568570
}
569571
}
570-
else
571-
fatal("internal error -- neither th nor fh specified in _tarReadRaw()");
572572
}
573573

574574
ctx->tarFHpos += res + used;

0 commit comments

Comments
 (0)