Обсуждение: Are "text" strings 0 terminated internally?

Поиск
Список
Период
Сортировка

Are "text" strings 0 terminated internally?

От
Bruno Wolff III
Дата:
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.


Re: Are "text" strings 0 terminated internally?

От
Tom Lane
Дата:
No, they aren't.

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