Re: Change atoi to strtol in same place

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Surafel Temesgen <surafel3000(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change atoi to strtol in same place
Date: 2019-07-05 22:40:53
Message-ID: 20190705224053.dydgpitc4vrla63i@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Surafel,

On Mon, Jul 01, 2019 at 08:48:27PM +0300, Surafel Temesgen wrote:
>Hello,
>
>we use atoi for user argument processing in same place which return zero
>for both invalid input and input value zero. In most case its ok because we
>error out with appropriate error message for input zero but in same place
>where we accept zero as valued input it case a problem by preceding for
>invalid input as input value zero. The attached patch change those place to
>strtol which can handle invalid input
>
>regards
>
>Surafel

This seems to have bit-rotted (due to minor changes to pg_basebackup).
Can you fix that and post an updated version?

In general, I think it's a good idea to fix those places, but I wonder
if we need to change the error messages too.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2019-07-05 23:07:36 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Bruce Momjian 2019-07-05 22:29:04 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)