summaryrefslogtreecommitdiff
path: root/contrib/intarray/_int_op.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/intarray/_int_op.c')
-rw-r--r--contrib/intarray/_int_op.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/intarray/_int_op.c b/contrib/intarray/_int_op.c
index 537174175b2..c30d3c8269f 100644
--- a/contrib/intarray/_int_op.c
+++ b/contrib/intarray/_int_op.c
@@ -200,9 +200,9 @@ Datum
sort(PG_FUNCTION_ARGS)
{
ArrayType *a = PG_GETARG_ARRAYTYPE_P_COPY(0);
- text *dirstr = (fcinfo->nargs == 2) ? PG_GETARG_TEXT_P(1) : NULL;
- int32 dc = (dirstr) ? VARSIZE(dirstr) - VARHDRSZ : 0;
- char *d = (dirstr) ? VARDATA(dirstr) : NULL;
+ text *dirstr = (fcinfo->nargs == 2) ? PG_GETARG_TEXT_PP(1) : NULL;
+ int32 dc = (dirstr) ? VARSIZE_ANY_EXHDR(dirstr) : 0;
+ char *d = (dirstr) ? VARDATA_ANY(dirstr) : NULL;
int dir = -1;
CHECKARRVALID(a);