Re: Remove line length restriction in passwordFromFile() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove line length restriction in passwordFromFile()
Date
Msg-id 54742.1598973287@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove line length restriction in passwordFromFile()  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Remove line length restriction in passwordFromFile()  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
Fujii Masao <masao.fujii@oss.nttdata.com> writes:
> The patch looks good to me, except the following minor thing.
> +        if (fgets(buf.data + buf.len, buf.maxlen - buf.len - 1, fp) == NULL)
> IIUC fgets() reads the data with the specified size - 1, so ISTM that -1 of
> "buf.maxlen - buf.len - 1" is not necessary.

Good point, I was being unduly conservative.  Thanks for reviewing
the patch!

            regards, tom lane



pgsql-hackers by date:

Previous
From: Li Japin
Date:
Subject: Re: Docs: inaccurate description about config settings
Next
From: Dave Page
Date:
Subject: Kerberos support broken on MSVC builds for Windows x64?