On Sun, Mar 20, 2022 at 9:32 PM Tom Lane <t...@sss.pgh.pa.us> wrote: > Robert Haas <robertmh...@gmail.com> 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?
No, and I thought I had checked properly for that condition before reaching the point in the code where I call strtol(), but it turns out I have not, which I guess is what Justin has been trying to tell me for a few emails now. I'll send an updated patch tomorrow after looking this all over more carefully. -- Robert Haas EDB: http://www.enterprisedb.com