Fix inappropriate uses of atol() - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Fix inappropriate uses of atol()
Date
Msg-id a52738ad-06bc-4d45-b59f-b38a8a89de49@eisentraut.org
Whole thread Raw
Responses Re: Fix inappropriate uses of atol()
List pgsql-hackers
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
Attachment

pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: WIP: parallel GiST index builds
Next
From: Andrew Dunstan
Date:
Subject: Re: Official devcontainer config