[PATCH] FIx alloc_var() ndigits thinko

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема [PATCH] FIx alloc_var() ndigits thinko
Дата
Msg-id ea480513-371c-4b55-8f23-a7c5e7727ae8@app.fastmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi,

I came across another harmless thinko in numeric.c.

It is harmless since 20/DEC_DIGITS and 40/DEC_DIGITS happens to be exactly 5 and 10 since DEC_DIGITS == 4,
but should be fixed anyway for correctness IMO.

-       alloc_var(var, 20 / DEC_DIGITS);
+       alloc_var(var, (20 + DEC_DIGITS - 1) / DEC_DIGITS);

-       alloc_var(var, 40 / DEC_DIGITS);
+       alloc_var(var, (40 + DEC_DIGITS - 1) / DEC_DIGITS);

/Joel

Вложения

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

Предыдущее
От: Jelte Fennema
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner
Следующее
От: David Zhang
Дата:
Сообщение: Re: psql: Add role's membership options to the \du+ command