pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: bharath.rupireddyforpostgres@gmail.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Incorrect usage of strtol, atoi for non-numeric junk inputs
Date: Thu, 22 Jul 2021 09:42:00 -0400
Message-ID: <202107221342.xyrtycgw44j4@alvherre.pgsql> (raw)
In-Reply-To: <YPgJ2Xo45hx8f4Id@paquier.xyz>

On 2021-Jul-21, Michael Paquier wrote:

> +/*
> + * option_parse_int
> + *
> + * Parse an integer for a given option.  Returns true if the parsing
> + * could be done with optionally *result holding the parsed value, and
> + * false on failure.
> + */

May I suggest for the second sentence something like "If the parsing is
successful, returns true and stores the result in *result if that's
given; if parsing fails, returns false"

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/
"Aprender sin pensar es inútil; pensar sin aprender, peligroso" (Confucio)





view thread (26+ messages)  latest in thread

Message-ID: <202107221342.xyrtycgw44j4@alvherre.pgsql>
Permalink:  ../202107221342.xyrtycgw44j4@alvherre.pgsql/
Also on:    postgresql.org/message-id/202107221342.xyrtycgw44j4@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, michael@paquier.xyz, horikyota.ntt@gmail.com, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Incorrect usage of strtol, atoi for non-numeric junk inputs
  In-Reply-To: <202107221342.xyrtycgw44j4@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox