Re: C Extension woes
| От | Andrew Chernow |
|---|---|
| Тема | Re: C Extension woes |
| Дата | |
| Msg-id | 48A2C327.7060900@esilo.com обсуждение исходный текст |
| Ответ на | C Extension woes (Tim Hawes <thawes@novadine.com>) |
| Ответы |
Re: C Extension woes
Re: C Extension woes |
| Список | pgsql-hackers |
Tim Hawes wrote:
>
> text * pl_masterkey(PG_FUNCTION_ARGS)
> {
> char *e_var = getenv("PGMASTERKEY");
> size_t length = VARSIZE(e_var) - VARHDRSZ;
>
>
The VARSIZE macro is for variable length structures, like a text or
bytea which contains a length and data member. You are using this macro
on a regular C string "e_var". Try this instead:
size_t length = e_var != NULL ? strlen(e_var) : 0;
--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/
В списке pgsql-hackers по дате отправления: