Re: Win32 fix for pg_dumpall

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Win32 fix for pg_dumpall
Дата
Msg-id 2729.1092621702@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Win32 fix for pg_dumpall  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Win32 fix for pg_dumpall  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>               /*
>                *    We emulate fgets() behaviour. So if there is no newline
>                *    at the end, we add one...
>                */
> !             if (line[len-1] != '\n')
>                   strcat(line,"\n");
>           }

This is untrustworthy if len is zero.  Perhaps

            if (len == 0 || line[len-1] != '\n')
                strcat(line,"\n");

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: psql tab-complete patch #3
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Add GUC_REPORT to server_encoding, integer_datetimes