Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6YyK-0001tp-35 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jul 2021 13:42:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6Yxn-00015R-Im for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jul 2021 13:42:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6Yxn-00014z-BI for pgsql-hackers@lists.postgresql.org; Thu, 22 Jul 2021 13:42:11 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6Yxi-0005M9-V3 for pgsql-hackers@lists.postgresql.org; Thu, 22 Jul 2021 13:42:10 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1FD345C0058; Thu, 22 Jul 2021 09:42:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 22 Jul 2021 09:42:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Czrc7pBo7OkgsNKBvbv2t3WrpK9x1mRCkKgZ9ntRXm8=; b=K0nM9+tB 5s9E6tc5CsIGvfjsYuXdr19SBJATVJrPSbAbbqC5c5zqAcEvHcQIflZVnpa/Gog6 GVdC7/p/lLF3b91/LToHJUFbOZrAJjiTSPDrJ+xN8ZltrgfyorU85Afeodw4Fj+4 Tn9N4eDh6Qs1a7KJ6qrm5w/HI+GbbHbiNskc5ooq2qfRxJfrIReJKejs8vWmKbx1 RwMZYmckZcxWHHfdXJV97ZebQ2Eu7hbrDRJrBEQxAXi24MA+1GDo6rXJ1tJhsDEp qG5Bs4s/ed5gytU3ObqsY/gLsoX5gN0ODuLXhTBNsEuA8S6oTtXmphXdvm5ulfwy 0S867zol/sAcNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeeigdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeevjedu feeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Jul 2021 09:42:02 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8FE302A09B6; Thu, 22 Jul 2021 09:42:00 -0400 (-04) Date: Thu, 22 Jul 2021 09:42:00 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Kyotaro Horiguchi , bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: Incorrect usage of strtol, atoi for non-numeric junk inputs Message-ID: <202107221342.xyrtycgw44j4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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)