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 1nW6uq-00057o-CI for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2022 01:33:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nW6up-0008JD-77 for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2022 01:32:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nW6uo-0008Iy-UP for pgsql-hackers@lists.postgresql.org; Mon, 21 Mar 2022 01:32:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nW6ui-0005sP-Es for pgsql-hackers@postgresql.org; Mon, 21 Mar 2022 01:32:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 22L1WjTZ1765520; Sun, 20 Mar 2022 21:32:45 -0400 From: Tom Lane To: Robert Haas cc: Justin Pryzby , Dipesh Pandit , Andres Freund , Jeevan Ladhe , Alvaro Herrera , "Shinoda, Noriyoshi (PN Japan FSIP)" , Abhijit Menon-Sen , Dmitry Dolgov <9erthalion6@gmail.com>, Jeevan Ladhe , Mark Dilger , "pgsql-hackers@postgresql.org" , tushar Subject: Re: refactoring basebackup.c (zstd workers) In-reply-to: References: <20220311010223.GI28503@telsasoft.com> <20220312015253.zokhkwdn5xbbd4vf@alap3.anarazel.de> <20220314163547.GT28503@telsasoft.com> <20220314171152.GU28503@telsasoft.com> <20220317194130.GM28503@telsasoft.com> <1565808.1647803514@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Sun, 20 Mar 2022 21:24:17 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1765518.1647826365.1@sss.pgh.pa.us> Date: Sun, 20 Mar 2022 21:32:45 -0400 Message-ID: <1765519.1647826365@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > I think I'm guilty of verbal inexactitude here but not bad coding. > Checking for *endptr != '\0', as I did, is not sufficient to detect > "whether an error occurred," as I alleged. But, in the part of my > response you didn't quote, I believe I made it clear that I only need > to detect garbage, not out-of-range values. And I think *endptr != > '\0' will do that. Hmm ... do you consider an empty string to be valid input? regards, tom lane