Fix inappropriate uses of atol()

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Fix inappropriate uses of atol()
Дата
Msg-id
a52738ad-06bc-4d45-b59f-b38a8a89de49@eisentraut.org
Список
Дерево обсуждения
Fix inappropriate uses of atol() Peter Eisentraut <peter@eisentraut.org>
Re: Fix inappropriate uses of atol() Heikki Linnakangas <hlinnaka@iki.fi>
Re: Fix inappropriate uses of atol() Tom Lane <tgl@sss.pgh.pa.us>
Re: Fix inappropriate uses of atol() Heikki Linnakangas <hlinnaka@iki.fi>
Re: Fix inappropriate uses of atol() Tom Lane <tgl@sss.pgh.pa.us>
Re: Fix inappropriate uses of atol() Peter Eisentraut <peter@eisentraut.org>
I noticed (during [0]) to some uses of the function atol() seem 
inappropriate.  Either they assume that sizeof(long)==8 and so might 
truncate data if not, or they are gratuitous because the surrounding 
code does not use the long type.  This patch fixes these, by using 
atoll() or atoi() instead.  (There are still some atol() calls left 
after this, which seemed ok to me.)

In the past, Windows didn't have atoll(), but the online documentation 
appears to indicate that this now works in VS 2015 and later, which is 
what we support at the moment.  The Cirrus CI passes.


[0]: 
https://www.postgresql.org/message-id/flat/5d216d1c-91f6-4cbe-95e2-b4cbd930520c@ewie.name
В списке pgsql-hackers по дате отправления
От: Andreas Karlsson
Дата:
От: Andrew Dunstan
Дата:
FAQ