Re: Incorrect usage of strtol, atoi for non-numeric junk inputs
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2021-07-22T13:42:00Z
Lists: pgsql-hackers
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)
Commits
-
Simplify matching pattern check in TAP tests of pg_receivewal
- 24ba1a87e405 15.0 landed
-
Skip trailing whitespaces when parsing integer options
- f7a9a3d4b24a 15.0 landed
-
Unify parsing logic for command-line integer options
- 6f164e6d1761 15.0 landed