diff options
Diffstat (limited to 'src/backend/utils/adt/varbit.c')
-rw-r--r-- | src/backend/utils/adt/varbit.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/utils/adt/varbit.c b/src/backend/utils/adt/varbit.c index 715a99863fd..7d98491d779 100644 --- a/src/backend/utils/adt/varbit.c +++ b/src/backend/utils/adt/varbit.c @@ -9,7 +9,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.26 2002/09/18 21:35:23 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varbit.c,v 1.27 2002/11/10 07:25:14 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -107,9 +107,8 @@ bit_in(PG_FUNCTION_ARGS) bitlen, atttypmod); len = VARBITTOTALLEN(atttypmod); - result = (VarBit *) palloc(len); /* set to 0 so that *r is always initialised and string is zero-padded */ - MemSet(result, 0, len); + result = (VarBit *) palloc0(len); VARATT_SIZEP(result) = len; VARBITLEN(result) = atttypmod; @@ -232,9 +231,8 @@ bit(PG_FUNCTION_ARGS) VARBITLEN(arg), len); rlen = VARBITTOTALLEN(len); - result = (VarBit *) palloc(rlen); /* set to 0 so that string is zero-padded */ - MemSet(result, 0, rlen); + result = (VarBit *) palloc0(rlen); VARATT_SIZEP(result) = rlen; VARBITLEN(result) = len; @@ -316,9 +314,8 @@ varbit_in(PG_FUNCTION_ARGS) atttypmod); len = VARBITTOTALLEN(bitlen); - result = (VarBit *) palloc(len); /* set to 0 so that *r is always initialised and string is zero-padded */ - MemSet(result, 0, len); + result = (VarBit *) palloc0(len); VARATT_SIZEP(result) = len; VARBITLEN(result) = Min(bitlen, atttypmod); |