Are "text" strings 0 terminated internally?

Started by Bruno Wolff IIIover 23 years ago2 messageshackers
Jump to latest
#1Bruno Wolff III
bruno@wolff.to

I want to make a function that converts text to cube and the "obvious"
thing to do is to call cube_in with the pointer from the text data.
However this depends on the text string being 0 terminated. I am very
sure that this is the case, but since I want to submit this change back
as a patch to contrib/cube I was hoping someone could make me 100%
sure this is correct. Thanks.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruno Wolff III (#1)
Re: Are "text" strings 0 terminated internally?

No, they aren't.

You should call textout if you want to convert a TEXT object into a C
string.

regards, tom lane