PQunescapeBytea Question

Started by Jerry LeVanover 21 years ago2 messagesgeneral
Jump to latest
#1Jerry LeVan
jerry.levan@eku.edu

Is there any chance that PQunescapeBytea will
always have a \000 at the end of the
unescaped buffer?

unescvalue = PQgetvalue(lastResult, row, fieldNum);
value = PQunescapeBytea(unescvalue, &size);

ie is "value" a C string or do I have to make
another copy so I can append a \000 byte?

Sigh, I expect the latter...

Jerry

#2Kris Jurka
books@ejurka.com
In reply to: Jerry LeVan (#1)
Re: PQunescapeBytea Question

On Thu, 5 Aug 2004, Jerry LeVan wrote:

Is there any chance that PQunescapeBytea will
always have a \000 at the end of the
unescaped buffer?

What would the point of that be? It's binary data and may have embedded
nulls so you'll need to always keep track of length separately.

Kris Jurka