diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 56657a42c4..a1e12a8aaa 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -174,7 +174,7 @@ reached_end_position(XLogRecPtr segendpos, uint32 timeline, lo; MemSet(xlogend, 0, sizeof(xlogend)); - r = read(bgpipe[0], xlogend, sizeof(xlogend)); + r = read(bgpipe[0], xlogend, sizeof(xlogend)-1); if (r < 0) { fprintf(stderr, _("%s: could not read from ready pipe: %s\n"),