Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: more custom...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 15463 of 16895
Post > Topic >>

Re: more custom C function fun

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--
 




 4 Posts in Topic:
more custom C function fun
heron@[EMAIL PROTECTED]   2008-05-05 23:43:40 
Re: more custom C function fun
kleptog@[EMAIL PROTECTED]  2008-05-06 08:48:26 
Re: more custom C function fun
heron@[EMAIL PROTECTED]   2008-05-06 09:39:50 
Re: more custom C function fun
kleptog@[EMAIL PROTECTED]  2008-05-06 17:59:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 13:09:52 CDT 2008.