Re: OID from insert has extra letter

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: OID from insert has extra letter
Дата
Msg-id 20010206183938.A22628@rice.edu
обсуждение исходный текст
Ответ на Re: OID from insert has extra letter  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Список pgsql-hackers
On Tue, Feb 06, 2001 at 06:17:46PM -0600, Ross J. Reedstrom wrote:
> 
> Seems it's a non-portable behavior:
> 
>       The  strncpy()  function  is similar, except that not more
>        than n bytes of src are copied. Thus, if there is no  null
>        byte among the first n bytes of src, the result wil not be
>        null-terminated.
> 
>        In the case where the length of src is less than  that  of
>        n, the remainder of dest will be padded with nulls.
> 
> I've already forgotten what platform the original bug report came from.

Just checked, D'Arcy never told us. But it doesn't matter, the manpage
lies.  I just tested it with a tiny little program that copies two
different constant strings into a buffer. Nothing get's padded with nulls,
as Tom knew. Once again, experience trumps book knowledge. (Checking
a couple random examples from my own code, I seem to have lucked out:
I've a habit of zeroing my buffers myself)

Ross


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: Include files for SPI are not installed
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [SQL] PL/PGSQL function with parameters