by kleptog@[EMAIL PROTECTED]
(Martijn van Oosterhout)
May 6, 2008 at 08:48 AM
--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, May 05, 2008 at 11:43:40PM -0600, Dan Heron Myers wrote:
> I have a custom C function that takes two text*s and returns a text*.
>=20
> text* calling_party =3D PG_GETARG_TEXT_P(0);
>=20
> char* thestr =3D VARDATA(calling_party);
> if(thestr[20] =3D=3D ')')
> {
> PG_RETURN_TEXT_P(calling_party);
> }
You do realise that VARDATA does not return a null terminated string?
Try using something like text_to_cstring or using elog(NOTICE) to
display what's actually being compared.
Have a nice day,
--=20
Martijn van Oosterhout <kleptog@[EMAIL PROTECTED]
> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while=20
> boarding. Thank you for flying nlogn airlines.
--yrj/dFKFPuw6o+aM
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIH/86IB7bNG8LQkwRAhZLAKCHj3RBoRBUitJ1j/IJi9zdewkhCwCfb3VK
7uH8mTBKZ6qYbPSDI3Nwqg8=
=bhfv
-----END PGP SIGNATURE-----
--yrj/dFKFPuw6o+aM--