summaryrefslogtreecommitdiff
path: root/src/backend/libpq/be-fsstubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/libpq/be-fsstubs.c')
-rw-r--r--src/backend/libpq/be-fsstubs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c
index f537affdd99..2cb60393852 100644
--- a/src/backend/libpq/be-fsstubs.c
+++ b/src/backend/libpq/be-fsstubs.c
@@ -399,12 +399,12 @@ Datum
be_lowrite(PG_FUNCTION_ARGS)
{
int32 fd = PG_GETARG_INT32(0);
- bytea *wbuf = PG_GETARG_BYTEA_P(1);
+ bytea *wbuf = PG_GETARG_BYTEA_PP(1);
int bytestowrite;
int totalwritten;
- bytestowrite = VARSIZE(wbuf) - VARHDRSZ;
- totalwritten = lo_write(fd, VARDATA(wbuf), bytestowrite);
+ bytestowrite = VARSIZE_ANY_EXHDR(wbuf);
+ totalwritten = lo_write(fd, VARDATA_ANY(wbuf), bytestowrite);
PG_RETURN_INT32(totalwritten);
}